Skip to content

Instantly share code, notes, and snippets.

@rafaelrozon
Last active February 13, 2019 19:33
Show Gist options
  • Save rafaelrozon/6dd570dfeb00bbadc9f0b825dd7ca5e0 to your computer and use it in GitHub Desktop.
Save rafaelrozon/6dd570dfeb00bbadc9f0b825dd7ca5e0 to your computer and use it in GitHub Desktop.
#docker,#cli

fetch image docker pull <image>

run image and open terminal in image

docker run alpine -it /bin/sh

docker run --name static-site -e AUTHOR="Rafa" -d -P seqvence/static-site

docker run --name static-site -e AUTHOR="Rafa" -d -p 8888:80 seqvence/static-site

list all ports of image docker port <image>

run multiple commands in docker-compose command: bash -c "commands...."

-d :flag runs the container in detached mode, i.e., the terminal exist but the container is still running --name : container name -e : env variables -d : detached mode -P : publish all container ports to ramdon ports in the host -p : maps host port to container port

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment