๐ง M Bytes #22: A few lessons about Docker -- want more?
Published 8 days agoย โขย 2 min read
|
Hey Reader,
I'm finding Docker to be increasingly relevant in the dawn of AI coding. You'll typically want to test out new code in a containerized environment before deploying it (eliminates the "it works on my machine!" madness), or provide the AI with a way to run rogue without your oversight (such as running Claude Code within a container using the `--dangerously-skip-permissions` flag).
I've been using Docker for well over a decade and was an early adopter, using it in my docker-magento project many years ago.
Here are a few lessons about Docker. If you'd like to learn more, please reply back and let me know, and I'll be sure to create some additional new lessons all about it! โ๏ธ
P.S. I've just deployed the below links to a new server, so please let me know how well (or not well) things go for you.
Keep coding,
|
|
|
Execute a command in a container in Docker
Once a Docker container has started, you need to know how to execute commands on the running container, and the way to do this is with exec:
|
|
|
Inspect container details in Docker
There's a big black box of data available to you to inspect everything related to any currently running Docker container:
|
|
|
Setting Up a Magento 2 Development Environment Using docker-magento
Still looking for a reliable Docker-based Magento dev env?
Look no further. Here's the one that I've built, maintained, and used every day since 2015:
|
|
|
You don't need Docker to run containers
Containers are timeless, and actually not linked to Docker at all. Docker is just a tool which allows you to access the container processes.
|
|
|
|
Create a Dockerfile in Docker
Docker containers run from images, and images are built from a Dockerfile, which is just a plain text doc in a specific format:
|
|
|
Thank you for being a University student ๐งก
Adobe Commerce Cert-Prep course is now available
If you haven't already, be sure to check out the Adobe Commerce Cert-Prep course, now available with unlimited exam retakes:
|
|
|