The ability to reply to discussions is limited to PRO members. Want to join in the discussion? Click here to subscribe now.

Run Short-Lived Docker Containers

Run Short-Lived Docker Containers

1:56
Learn the benefits of running one-off, short-lived Docker containers. Short-Lived containers are useful to execute one-line commands or setup scheduled tasks. We'll demonstrate setting up a cronjob from the host machine to tap into the benefits of running automated, timed scripts with Docker.
Watch this lesson now
Avatar
egghead.io

Learn the benefits of running one-off, short-lived Docker containers. Short-Lived containers are useful to execute one-line commands or setup scheduled tasks. We'll demonstrate setting up a cronjob from the host machine to tap into the benefits of running automated, timed scripts with Docker.

Avatar
David

Wow, this is really cool!

Let's say I have a javascript file, destined to run via node. We'll call this 'my-test.js'

I don't think I could execute that script without creating a volume for the container for it to even have access to the script. After I did that, I could run the script.

But I'm just curious if there's a shorter/terser way of doing exactly that.

In reply to egghead.io
Avatar
Brandon

Can you watch this if you've never used Docker before? Is this suitable for beginners? Or is this more for someone who has already worked some with Docker before?

In reply to egghead.io
Avatar
Mark

Hi Brandon,

You can to grasp some of the concepts to Docker. However, watching through some of my other Docker videos will help understand more broader concepts.

Mark

In reply to Brandon
Avatar
Mark

Hi David,

You can also use the CP command to copy the my-test.js file into your Docker container, and that would eliminate the need to mount a volume. You have to get that file into the container somehow though :)

Mark

In reply to David
HEY, QUICK QUESTION!
Joel's Head
Why are we asking?