testing - Add a link to docker run -
i making test file. need have docker image , run this: docker run www.google.com
everytime url changes, need pass file inside docker. possible?
sure. need custom docker image possible.
let's want execute command "ping -c 3" , pass parameter send in command line.
you can build custom image following dockerfile
:
from alpine:latest copy entrypoint.sh /entrypoint.sh run chmod +x /entrypoint.sh entrypoint /entrypoint.sh
the entrypoint.sh
file contains following:
#!/bin/sh ping -c 3 "$website"
then, have build image running:
docker build -t pinger .
now, can run image command:
docker run --rm -e website=www.google.com pinger
by changing value of website env variable in latest step can requested.
wiki
Comments
Post a Comment