Docker cheat-sheet

Docker is great for development, but also, it gives you the superpower of extremely small images to easily move around docker containers.

I need this for personal stuff, but I think it can be useful to others, so let’s share it.

It’s a living list so I’m gonna add here stuff as soon as I need it.

Foreplay (Composer) – a.k.a. Install fest
#Install composer:
sudo apt-get -y install python-pip
sudo pip install docker-compose
#Build an image from a dockerfile in pwd:
docker build --rm=true -t tagname .
#--rm=true -> Remove intermediate containers after a successful build
#-t, --tag=[] -> Name and optionally a tag in the 'name:tag' format
#-f, --file -> Name of the Dockerfile (Default is 'PATH/Dockerfile')
Docker Composer
#Start a container with:
docker-compose up -d
#up -> Create and start containers
#-d -> Detached mode: Run containers in the background,
       print new container names.
       Incompatible with --abort-on-container-exit.
#Check what's running:
docker ps

#Stop container:
docker stop {containerid}


(Visited 254 times, 1 visits today)

2 Replies to “Docker cheat-sheet”

  1. Hi Giuseppe Urso,

    I have a question for you that I think will be easy to answer because you have a WordPress Blog and are a Debian user. I know your blog is not for tech support, so I sincerely apologize for asking. I am moving all my WordPress hosting to Google Cloud Platform Compute Engine from Backspace Cloud Sites. I am using Duplicator to restore some of the WP sites from a zip archive. The first site I successfully restored went well but only the home page works. The other URLs give me these error message “404 Not Found” and “The requested URL /blog/ was not found on this server.” and “Apache/2.4.10 (Debian) Server at Port 443”

    I searched on Stackoverflow to no avail. I also contacted the tech support at Duplicator and I am awaiting their reply. Their initial response was it’s likely the htaccess or wp-config.php file. I confirmed that mod rewrite is working on Apache. I am wondering if the issue could be the way I installed the Lets Encrypt SSL using a VHosts setting. I am lost. Also, I am just learning all of this stuff about Debian, Apache, etc. so I am not experienced like you. If you can point me in the direction where I can find an answer, I promise I will not bother you with endless emails and questions. Thanks for your consideration.


Leave a Reply

Your email address will not be published. Required fields are marked *