Run One-Off Docker Containers

Share this video with your friends

Send Tweet

You’ll often need to execute various administrative or maintenance tasks for your app, such as database migrations or arbitrary console commands.

In this lesson, we will learn how to run arbitrary one-off commands as disposable Docker containers.

Stephen James
Stephen James
~ 7 years ago

Interesting course, this one will need to be watched and referenced over and over to absorb all of the good stuff.

Mark Shust
Mark Shust(instructor)
~ 7 years ago

Thank you, I agree some of these concepts need repetition in order for them to sick.

Eugene Rwagasore
Eugene Rwagasore
~ 7 years ago

Great course @Mark. I like the load-balancing with nginx part. I was hoping to see how to use nginx as proxy and setup https with letsencrypt. It has proven to be hard to do. Thanks again for this.

Mark Shust
Mark Shust(instructor)
~ 7 years ago

Thanks! FYI I have more Docker lessons at:

https://egghead.io/instructors/mark-shust

I actually have a lesson directly pertaining to setting up an nginx proxy:

https://egghead.io/lessons/setup-an-nginx-proxy-for-a-node-js-app

Proxies aren't a part of 12-factor apps (but... maybe they should be!), so I left it out of this course. Thanks for the recommendation, I always used to have a hard time figuring out proxies.

For lets encrypt, at least for non-Docker setups I would highly recommend Certbot. I hope to have a lesson out soon on using certbot/letsencrypt with Docker, as it's been notoriously difficult to set that up.

Michael
Michael
~ 7 years ago

How to run tasks in development that modify the codebase? For example, I'd like to run yarn add <package-name> without installing yarn on my local machine. I'd like to run it in the container (same environment as my app runs). However, the changes to package.json and yarn.lock have to be applied to my codebase on my local machine.

Samuel Okoroafor
Samuel Okoroafor
~ 6 years ago

@Michael, maybe a volume mapping to the codebase directory would help. But you'll need to remove the mapping to your local node_modules directory in docker-compose.yml.

Then execute docker-compose exec <service-name> commands

josh
josh
~ 6 years ago

this course is a little scattered. seems more like a collection of loosely related lessons than a cohesive course :/

Mark Shust
Mark Shust(instructor)
~ 6 years ago

I agree -- it's the best I could do with 12-factor, and covering one video per lesson, otherwise this would have been a 30+ lesson course. I'm hoping to cover Docker basics in another course. I'm still hoping this course is very useful though to understand the base concepts of 12-factor apps.

J. Matthew
J. Matthew
~ 5 years ago

I'm hoping to cover Docker basics in another course.

I don't know if you assembled the following playlist of your videos or not, but I found it extremely helpful for answering that exact need: https://egghead.io/playlists/docker-fundamentals-0cb53b55. In my opinion this playlist serves as a de facto "Getting Started with Docker" course.