What I wish to do is: start docker interactive mode with /bin/bash, and automatically sources /etc/environment
I’ve this at the end of my Dockerfile:
RUN chmod o+x /etc/environment ENV GO111MODULE=on ENTRYPOINT ["/bin/bash"] CMD ["/bin/bash"]
I ran command:
sudo docker run -it myimage -c "/etc/environment"
It seems ok, but I don’t enter docker container. Seems ENTRYPOINT command will execute bash and quit?
Then I changed the entry point line to:
ENTRYPOINT ["/bin/bash", "-c", "source /etc/environment"]
And rebuilt the image.
sudo docker run -it myimage
Again, seems to end after docker run at once. Doesn’t work either. How to fix it? Thanks a lot.