|
| 1 | +# Rocky Linux |
| 2 | + |
| 3 | +Rocky Linux is a community-supported distribution derived from sources freely provided to the public by [Red Hat](ftp://ftp.redhat.com/pub/redhat/linux/enterprise/) for Red Hat Enterprise Linux (RHEL). As such, Rocky Linux aims to be functionally compatible with RHEL. The Rocky Linux Project mainly changes packages to remove upstream vendor branding and artwork. Rocky Linux is no-cost and free to redistribute. Each Rocky Linux version is maintained for up to 10 years (by means of security updates -- the duration of the support interval by Red Hat has varied over time with respect to Sources released). A new Rocky Linux version is released approximately every 2 years and each Rocky Linux version is periodically updated (roughly every 6 months) to support newer hardware. This results in a secure, low-maintenance, reliable, predictable, and reproducible Linux environment. |
| 4 | + |
| 5 | +Thank you for using Rocky Linux! We appreciate your feedback and welcome you to the community! Please join us on IRC |
| 6 | +on Libera.chat in #rockylinux or on our Mattermost instance at https://chat.rockylinux.org |
| 7 | + |
| 8 | +> [docs.rockylinux.org](https://docs.rockylinux.org) |
| 9 | +> [wiki.rockylinux.org](https://wiki.rockylinux.org) |
| 10 | +
|
| 11 | +%%LOGO%% |
| 12 | + |
| 13 | +# CentOS image documentation |
| 14 | + |
| 15 | +The `%%IMAGE%%:latest` tag is always the most recent version currently available. |
| 16 | + |
| 17 | +## Rolling builds |
| 18 | + |
| 19 | +Rocky Linux offers regularly updated images for all active releases. These images will be updated monthly or as needed for emergency fixes. These rolling updates are tagged with the major version number only. For example: `docker pull %%IMAGE%%:8`. |
| 20 | + |
| 21 | +## Minor tags |
| 22 | + |
| 23 | +Additionally, images with minor version tags that correspond to install media are also offered. **These images DO NOT receive updates** as they are intended to match installation iso contents. If you choose to use these images it is highly recommended that you include `RUN yum -y update && yum clean all` in your Dockerfile, or otherwise address any potential security concerns. To use these images, please specify the minor version tag: |
| 24 | + |
| 25 | +For example: `docker pull %%IMAGE%%:8.4` |
| 26 | + |
| 27 | +# Package documentation |
| 28 | + |
| 29 | +By default, the CentOS containers are built using yum's `nodocs` option, which helps reduce the size of the image. If you install a package and discover files missing, please comment out the line `tsflags=nodocs` in `/etc/yum.conf` and reinstall your package. |
| 30 | + |
| 31 | +# Systemd integration |
| 32 | + |
| 33 | +Systemd is now included in the %%IMAGE%%:latest base containers, but it is not active by default. In order to use systemd, you will need to include text similar to the example Dockerfile below: |
| 34 | + |
| 35 | +## Dockerfile for systemd base image |
| 36 | + |
| 37 | +```dockerfile |
| 38 | +FROM %%IMAGE%%:8.4 |
| 39 | +ENV container docker |
| 40 | +RUN (cd /lib/systemd/system/sysinit.target.wants/; for i in *; do [ $i == \ |
| 41 | +systemd-tmpfiles-setup.service ] || rm -f $i; done); \ |
| 42 | +rm -f /lib/systemd/system/multi-user.target.wants/*;\ |
| 43 | +rm -f /etc/systemd/system/*.wants/*;\ |
| 44 | +rm -f /lib/systemd/system/local-fs.target.wants/*; \ |
| 45 | +rm -f /lib/systemd/system/sockets.target.wants/*udev*; \ |
| 46 | +rm -f /lib/systemd/system/sockets.target.wants/*initctl*; \ |
| 47 | +rm -f /lib/systemd/system/basic.target.wants/*;\ |
| 48 | +rm -f /lib/systemd/system/anaconda.target.wants/*; |
| 49 | +VOLUME [ "/sys/fs/cgroup" ] |
| 50 | +CMD ["/usr/sbin/init"] |
| 51 | +``` |
| 52 | + |
| 53 | +This Dockerfile deletes a number of unit files which might cause issues. From here, you are ready to build your base image. |
| 54 | + |
| 55 | +```console |
| 56 | +$ docker build --rm -t local/r8-systemd . |
| 57 | +``` |
| 58 | + |
| 59 | +## Example systemd enabled app container |
| 60 | + |
| 61 | +In order to use the systemd enabled base container created above, you will need to create your `Dockerfile` similar to the one below. |
| 62 | + |
| 63 | +```dockerfile |
| 64 | +FROM local/r8-systemd |
| 65 | +RUN yum -y install httpd; yum clean all; systemctl enable httpd.service |
| 66 | +EXPOSE 80 |
| 67 | +CMD ["/usr/sbin/init"] |
| 68 | +``` |
| 69 | + |
| 70 | +Build this image: |
| 71 | + |
| 72 | +```console |
| 73 | +$ docker build --rm -t local/r8-systemd-httpd . |
| 74 | +``` |
| 75 | + |
| 76 | +## Running a systemd enabled app container |
| 77 | + |
| 78 | +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. |
| 79 | + |
| 80 | +```console |
| 81 | +$ docker run -ti -v /sys/fs/cgroup:/sys/fs/cgroup:ro -p 80:80 local/r8-systemd-httpd |
| 82 | +``` |
| 83 | + |
| 84 | +This container is running with systemd in a limited context, with the cgroups filesystem mounted. There have been reports that if you're using an Ubuntu host, you will need to add `-v /tmp/$(mktemp -d):/run` in addition to the cgroups mount. |
| 85 | + |
0 commit comments