Last active
May 11, 2020 00:53
-
-
Save anandrajneesh/a712221c96b60da20db1f7db21b5c1a6 to your computer and use it in GitHub Desktop.
Docker notes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
docker container start | |
docker container stop | |
docker container rm | |
docker network create <name> | |
docker network connect <network> <container> | |
docker network ls | |
docker container ls | |
docker build | |
docker run | |
docker attach | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM - for base image | |
ADD/COPY - to copy files from one dir to other ... COPY preffered | |
WORKDIR - to set working directory | |
RUN - to run commands during docker build | |
CMD/ ENTRYPOINT - cmd to run at docker run .. ENTRYPOINT preferred |
If you want to poke around inside a running container:
docker run --name myapp -ti --entrypoint /bin/sh myorg/myapp
$ docker exec -ti myapp /bin/sh
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If you want to poke around inside a image:
docker run -ti --entrypoint /bin/sh imagename