Sign inSign up

hjben/centos-systemd

By hjben

•Updated over 3 years ago

CentOS base image with systemd(systemctl command)-enabled and some utilities

Image
0

1.0K

hjben/centos-systemd repository overview

⁠centos-systemd

⁠Introduction

CentOS base image with systemd(systemctl command)-enabled and some utilities

⁠Usage
⁠1. Pull image
  • Pull docker image from the DockerHub with the latest tag, or build the image with Dockerfile.
    • docker pull hjben/centos-systemd:latest
⁠2. Run container
  • Command to run centos container is below.
    • docker run -d --privileged --cgroupns=host --name {container_name} -v /sys/fs/cgroup:/sys/fs/cgroup:rw hjben/centos-systemd:latest
    • e.g. docker run -d --privileged --cgroupns=host --name centos -v /sys/fs/cgroup:/sys/fs/cgroup:rw hjben/centos-systemd:latest
  • Command Description
    • -d: Run with daemon (background) mode
    • --privileged: Share the host permission with container
    • --cgroupns=host: Privilege the host's cgroup
    • --name {container_name}: Set container name to {container_name}
    • -v /sys/fs/cgroup:/sys/fs/cgroup:rw: Share the disk volume between host and container, to access host cgroup from the container
⁠3. Access to the container BASH shell
  • You can access the container by typing the "docker exec" command.
    • docker exec -it {container_name} bash
    • e.g. docker exec -it centos bash
⁠4. Then, enjoy your CentOS!

Tag summary

Content type

Image

Digest

sha256:00cc80fb0…

Size

280.4 MB

Last updated

over 3 years ago

docker pull hjben/centos-systemd