openanolis/anolisos

By openanolis

Updated over 1 year ago

Anolis OS is an open source Linux distribution issued by the OpenAnolis community.

Image
48

100K+

Anolis OS

Introduction

Anolis OS 8 is an open source Linux distribution issued by the OpenAnolis community. It is absolutely compatible with CentOS 8, supports multi-computing architecture, and provides a stable, high-performance, safe and reliable operating system.

Anolis OS Base Images

Official Anolis OS base image published by OpenAnolis community.

Supported tags and respective Dockerfile links
Supported architectures
  • arm64, amd64

Systemd integration

In order to use systemd, you will need to include text similar to the example Dockerfile below:

Dockerfile for systemd base image
FROM openanolis/anolisos:8.2-x86_64
ENV container docker
RUN (cd /lib/systemd/system/sysinit.target.wants/; for i in *; do [ $i == \
systemd-tmpfiles-setup.service ] || rm -f $i; done); \
rm -f /lib/systemd/system/multi-user.target.wants/*;\
rm -f /etc/systemd/system/*.wants/*;\
rm -f /lib/systemd/system/local-fs.target.wants/*; \
rm -f /lib/systemd/system/sockets.target.wants/*udev*; \
rm -f /lib/systemd/system/sockets.target.wants/*initctl*; \
rm -f /lib/systemd/system/basic.target.wants/*;\
rm -f /lib/systemd/system/anaconda.target.wants/*;
VOLUME [ "/sys/fs/cgroup" ]
CMD ["/usr/sbin/init"]

This Dockerfile deletes a number of unit files which might cause issues. From here, you are ready to build your base image.

# docker build --rm -t local/an8-systemd .

Example systemd enabled app container

In order to use the systemd enabled base container created above, you will need to create your Dockerfile similar to the one below.

FROM local/an8-systemd
RUN dnf -y install httpd; dnf clean all; systemctl enable httpd.service
EXPOSE 80
CMD ["/usr/sbin/init"]

Build this image:

# docker build --rm -t local/an8-systemd-httpd .

Running a systemd enabled app container

In order to run a container with systemd, you will need to mount the cgroups volumes from the host. Below is an example command that will run the systemd enabled httpd container created earlier.

# docker run -ti -v /sys/fs/cgroup:/sys/fs/cgroup:ro -p 80:80 local/an8-systemd-httpd

Docker Pull Command

docker pull openanolis/anolisos