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
Images
#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.
Containers
#Check what's running:
docker ps

#Stop container:
docker stop {containerid}

 

(Visited 262 times, 1 visits today)

Author: Giuseppe Urso

Giuseppe lives in Haarlem now with his shiny dog, Filippa
In 1982 received his first home computer, a Commodore 64, followed by Datasette and a 1541 Floppy Disk Drive.
In 1999 he installed his first Linux distro (LRH6).
In 2006 he switched to Debian as favourite OS. Giuseppe Urso actively sustains the Free Software Fundation and his founder Richard Mattew Stallman, he speaks to people trying to convince them to join the fight now, and about how important is to use Free Software only.
He has a job as Infra Specialist at Hippo Enterprise Java Cms an Open Source Enterprise class Content Management System, one of the coolest company ever, in Amsterdam. He’s always ready to install Debian on other people computers for free.

2 thoughts on “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.

    Dante

Leave a Reply

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