Last active
August 29, 2015 14:16
-
-
Save lysender/c5bfe9a9189cec6af3ee to your computer and use it in GitHub Desktop.
Docker noob commands
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
# Build an image based on docker file (--rm to delete intermediate containers) | |
docker build --rm -t mmage/app . | |
# Run the container (create a name for it as well) | |
# run as daemon, map 8080 to containers 80 port | |
docker run --name=mmage_app -d -p 8080:80 mmage/app | |
# Stop a named container | |
docker stop mmage_app | |
# Start it again | |
docker start mmage_app | |
# Bash in to container | |
docker exec -it mmage_app bash | |
# Link a named container into another container | |
docker run --name=mmage_app -d -p 8080:80 --link mmage_db:db mmage/app |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment