Linux Format

Do Docker like an adult!

In the world of ephemeral services, Docker images provide a great way to have disposable I services on a ‘quick in, quick out’ scenario. With that ease of use, bad practice can creep in. Here we’re discussing some of the ways to optimise production usage of Docker in a single-host scenario.

While it is simple enough to just run Docker from the command line using various switches, you are missing a big time-saving trick. Replacing those command lines with Docker Compose and a YAML Docker config file is a much better way to achieve a consistent outcome. Using Docker Compose also cleans up after itself, removing resources when it is brought down, so it makes complete sense to use it.

Using a single file, you can include an entire software stack defined in one file that can be deployed, version-controlled and consistent. You could use a script but it’s not the ’90s any more. You do, however, need to install the tool to use it. For example, in Ubuntu, it’s as simple as: $ sudo apt install -y docker-compose

You’re reading a preview, subscribe to read more.

More from Linux Format

Linux Format2 min read
OBS Studio
Version: 30.0.2 Web: https://obsproject.com There are lots of good options for recording screencasts, but if you want to live-stream T your desktop, one of the best options is OBS Studio. The app works with all the major online streaming providers, s
Linux Format1 min read
Wine For Wayland
2023 was a great year for the Wayland driver for Wine. The goal was to move forward from the experimental phase and make the driver a proper upstream component. A year later, after several merge requests, many people are now already able to use the l
Linux Format2 min read
Back Issues Missed One?
ISSUE 313 April 2024 Product code: LXFDB0313 In the magazine Discover how to use the ultimate hacker’s toolkit, staying out of trouble while doing so. And join us as we take the Puppy Linux developer’s new distro for a run and explore its container

Related Books & Audiobooks