Skip to Content
Linux Administration Cookbook
book

Linux Administration Cookbook

by Adam K. Dean
December 2018
Beginner
826 pages
22h 54m
English
Packt Publishing
Content preview from Linux Administration Cookbook

Creating a container

Starting with the creation of our new container, this was the command we used:

$ sudo docker run -itd --rm alpine /bin/ash

Here, we're telling Docker we want to run a command in a new container:

docker run

We're then informing it that we want it to be interactive, to have a pseudo-TTY, and to start detached (knocking us back to the VM shell):

-itd

Next, we're telling Docker that when the container stops, we want it to automatically remove itself:

--rm
This is a relatively new feature, only introduced because people didn't realize containers linger after they stop, and people would end up with lists of hundreds of stopped containers.

Lastly, we're saying what image (from Docker Hub) we want to use, and what command to ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Practical Linux Security Cookbook - Second Edition

Practical Linux Security Cookbook - Second Edition

Tajinder Kalsi
Mastering Linux Administration

Mastering Linux Administration

Alexandru Calcatinge, Julian Balog

Publisher Resources

ISBN: 9781789342529Supplemental Content