build an image
docker build -t busybox .
run container with env. variable & run CMD in Dockerfile
docker run busybox
override env. variable in Dockerfile
docker run --env ENV_TARGET=yahoo.com busybox
override CMD in Dockerfile
docker run busybox sh -c 'whoami && pwd'
Dockerfile
FROM busybox WORKDIR /app ENV ENV_TARGET google.com COPY subs.sh subs.sh RUN chmod +x subs.sh CMD ["/app/subs.sh"]
subs.sh
#!/bin/sh ping -c 2 ${ENV_TARGET}
No comments:
Post a Comment