Creating a Systemd Compatible Debian Container

1 hour
  • 3 Learning Objectives

About this Hands-on Lab

Containers are being used constantly to provide flexibility and consistency among builds and environments. Introducing the ability to manage services within a container adds to the use case potential of containers. During this activity, the student will practice the steps necessary to create containers that support systemd within them.

Learning Objectives

Successfully complete this lab by achieving the following learning objectives:

Container Filesystem Structure Created

The student is asked to create the filesystem and structure the container will be using. The location (and name of the container) will be called ‘test’.

Systemd Managed Container is Enabled for Persistency

The ‘test’ container should be enabled so that it restarts on boot automatically.

Container is Running

The student is asked to verify that the container is running before turning it over to the development team.

Additional Resources

Your development team continues the development of a new Web-based API. They have thus far been working on full virtual systems running Apache. However, they are ready to start breaking out their non-production environments (QA, User Acceptance, Load Testing, etc). Since these non-production environments will not be in use constantly, there is no need to dedicate full instances to them.

As a result, you have been provided credentials and login information to a CentOS 7 system intended to be shared amongst a variety of non-production environments that will be ephemeral in nature. However, it is important for them to otherwise match the production implementation.

You have been asked to configure a Debian container within the CentOS 7 host you are working on. This container will be the first non-production environment on this host and the developers will be using this to build out the Test environment, keeping it separate from the underlying host.

You will need to install the necessary packages and filesystem structure to the appropriate location to create a container called 'test'. Once you are able to launch the container using the appropriate 'systemd' command, you will need to connect to it and provision two users (see below - do not forget to rename the PAM module within the container to allow users to login to it directly).

Finally, set the container with systemd so that it runs as a service and will restart anytime the system itself is restarted. Once you verify it is running, you can turn it over to the development team for use.

Jon Riker - Username: jriker
Dee Troy - Username: dtroy

Note: To permanently disable selinux: vi /etc/sysconfig/selinux and set the following: SELINUX=disable and restart.

What are Hands-on Labs

Hands-on Labs are real environments created by industry experts to help you learn. These environments help you gain knowledge and experience, practice without compromising your system, test without risk, destroy without fear, and let you learn from your mistakes. Hands-on Labs: practice your skills before delivering in the real world.

Sign In
Welcome Back!

Psst…this one if you’ve been moved to ACG!

Get Started
Who’s going to be learning?