Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // fetch image
- docker pull <image>
- // run image and open terminal in image
- // -d flag runs the container in detached mode, i.e., the terminal exist but the container is still running
- docker run alpine -it /bin/sh
- /*
- --name : container name
- -e : env variables
- -d : detached mode
- -P : publish all container ports to ramdon ports in the host
- */
- docker run --name static-site -e AUTHOR="Rafa" -d -P seqvence/static-site
- /*
- -p : maps host port to container port
- */
- docker run --name static-site -e AUTHOR="Rafa" -d -p 8888:80 seqvence/static-site
- /*
- list all ports of image
- */
- docker port <image>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement