
Basic Docker Commands for Beginners - bjoko
https://codeopolis.com/posts/25-basic-docker-commands-for-beginners
======
wicket
> If you’re trying to learn Docker you will first have to master its various
> terminal commands.

This is completely the wrong way to go about learning Docker. The biggest
problem with Docker is that there are too many people using it who claim they
know Docker because they learnt a few commands they read on the internet, but
they don't actually understand what a container is. In reality, this leads to
all sorts of problems, like the deployment of insecure containers in the wild.
Guides like this are recipe for disaster.

~~~
gspr
Somewhat related to this: although I like to imagine I'm still young (hah!),
dynamic and open, I'm quite set in my ways and conservative with software
(Debian is my distro of choice on any computer). There's two particular areas
where I've tried to learn newfangled stuff over the past few years: deep
learning frameworks (because I find the field interesting) and Docker (because
it does seem very practical in some circumstances). I feel _exhausted_ by how
hard it can be to find good information on either one! Everything I need is
usually out there, but it's buried in pages upon pages of google hits that are
short recipes or "tutorials" that involve sequencing a bunch of runes without
communicating any understanding of what's going on.

Does anyone have a good strategy when approaching such hyped up topics (not in
particular the aforementioned ones) where almost all sources seem to focus on
"just getting it working" and lowering the barrier to entry? I don't mean to
promote gatekeeping here, it's just that I personally can't learn from the
"just do this then this" style.

~~~
skrtskrt
I just had the same experience digging into Oauth2 and user authentication.
Everything “guide” in google search is trying to sell you something, so it
just “gets you up and running” with their proprietary software. (Auth0,
Google, etc) The Orielly-esque books on the topic are terrible, with terrible
explanations paired with terrible code.

I’m dying for like a full 100% deep dive on secure, modern web authentication
and authorized, with matching code examples, just because I’m so curious about
the subject.

The best I’ve done so far is to read some open source Oauth code like fosite-
but this still doesn’t cover user authentication, or key signing best
practices, or secret management or (all the other things I don’t know about
but could contribute to an insecure implementation).

I feel like I’m at best getting 10% of the picture.

------
globular-toast
The problem with these kind of Docker "recipe books" is users very quickly
build up an unmanageable number of containers, images, networks, volumes etc.
on their Docker hosts. When these users inevitably run into unexpected
behaviour (or run out of disk space) their only solution is to "destroy the
world" with some other recipe like a "docker prune".

I see similar things with git users who only learn recipes. I die a little
inside every time I see someone fix their problems by deleting and recloning
the repo because that's what it says to do on "ohshitgit.com".

~~~
AzzieElbab
I think you are confusing dev and prod. Who cares how I got local kafka
running?

~~~
qppo
Your coworker who doesn't know what the fuck Kafka is or why you need it to
get the system online.

~~~
AzzieElbab
assuming my coworker is burrowing my laptop? I will reiterate, docker is
amazing for setting up and tearing down complex software locally for dev.
Productialization is a whole different story. For example, in case of kafka or
kdb or scylla I would not even run them in docker to begin with.

------
pibefision
I prefer Docker Compose to script all my docker tasks. It's easy, requires
some understanding first (ie: environment variables) but after that you have
reusable recipes.

~~~
markl42
Shameless plug time! I made
[https://composerize.com/](https://composerize.com/) for exactly this -
converting all the docker run commands from tutorials and such into reusable
compose files :)

~~~
kovacs_
This is actually one of my largest struggles with docker currently. Thanks for
linking your tool!

------
team-o
I personally find the interactive switch very useful to actually control the
container. You can use "-it" flag for this.

    
    
      docker run -it [IMAGE_NAME] [ENTRYPOINT] 

e.g.

    
    
      docker run -it ubuntu:xenial /bin/bash

~~~
fauria
I would recommend adding "\--rm", to avoid leaving leftovers when the
container exits:

[https://docs.docker.com/engine/reference/run/#clean-up---
rm](https://docs.docker.com/engine/reference/run/#clean-up---rm)

