DEV Community

Michael Currin
Michael Currin

Posted on • Edited on

2

Docker containers quickstart

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
Enter fullscreen mode Exit fullscreen mode

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 -
Enter fullscreen mode Exit fullscreen mode

Command:

docker build .
Enter fullscreen mode Exit fullscreen mode

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.

Do your career a big favor. Join DEV. (The website you're on right now)

It takes one minute, it's free, and is worth it for your career.

Get started

Community matters

Top comments (0)

👋 Kindness is contagious

Discover a treasure trove of wisdom within this insightful piece, highly respected in the nurturing DEV Community enviroment. Developers, whether novice or expert, are encouraged to participate and add to our shared knowledge basin.

A simple "thank you" can illuminate someone's day. Express your appreciation in the comments section!

On DEV, sharing ideas smoothens our journey and strengthens our community ties. Learn something useful? Offering a quick thanks to the author is deeply appreciated.

Okay