loading...

Docker containers quickstart

michaelcurrin profile image Mike Updated on ・2 min read

Docker intro video

I felt inspired by watching a YouTube talk about Docker recently - I liked hearing the origins of Docker, seeing a couple ways to spin up containers and also the humor of the speaker. I highly recommend it.

New project

In fact I decided to take my learnings from that video and build a new Github repo around it, to practice the commands and build up a reference for when I get stuck.

This assumes some knowledge of Docker and so focuses on providing commands to manage containers either built just from remote images (no Dockerfile needed) or from a local Dockerfile supplied in the project.

Extracts

Build without a Dockerfile

docker pull centos
docker run -d -t --name my-container centos

From Basic guide.

Build with Dockerfile

Dockerfile contents:

FROM ubuntu

RUN apt update && \
    apt install -q -y git

CMD echo "This is a test." | wc -

Command:

docker build .

From Generic example.

Resources

If you need more links on Docker then check out this list of resources.

I've also been working on a cheatsheet recently for running docker, docker-compose and kubectl (Kubernetes control).

Container boilerplate post

I came across this post on on dev.to which I'd like to pass on.

Posted on by:

michaelcurrin profile

Mike

@michaelcurrin

I'm a self-taught dev focused on websites and Python development. My friends call me the "Data Genie". When I get bored, I find tech to read about, write about and build things with.

Discussion

markdown guide