Skip to content

Instantly share code, notes, and snippets.

@yanniboi
Created September 20, 2016 10:31
Show Gist options
  • Save yanniboi/fbade5e4faa00a202877e9a899df180f to your computer and use it in GitHub Desktop.
Save yanniboi/fbade5e4faa00a202877e9a899df180f to your computer and use it in GitHub Desktop.
Docker command cheatsheet
#!/bin/sh
# Get docker image.
docker pull yanniboi/ubuntu-php
cd yanniboi-php
# Start a new container
docker run -it --name mycontainer1 yanniboi/ubuntu-php
# Make changes
# exit - to finish
# docker run mycontainer1 - if you need to get back
# Commit changes to docker image
docker commit mycontainer1 yanniboi/ubuntu-php
# Push changes to head.
docker push yanniboi/ubuntu-php
# Remove container when finished
docker rm mycontainer1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment