From 897e3222746392f022055571a3de660dd8befffa Mon Sep 17 00:00:00 2001 From: Melekhin Anton Date: Sat, 24 Aug 2024 16:50:24 +0400 Subject: [PATCH] feat: add `amazonlinux/2.Dockerfile` --- .github/workflows/build-and-push.yml | 4 ++++ README.md | 1 + amazonlinux/2.Dockerfile | 25 +++++++++++++++++++++++++ 3 files changed, 30 insertions(+) create mode 100644 amazonlinux/2.Dockerfile diff --git a/.github/workflows/build-and-push.yml b/.github/workflows/build-and-push.yml index e610c07..46b1728 100644 --- a/.github/workflows/build-and-push.yml +++ b/.github/workflows/build-and-push.yml @@ -16,6 +16,10 @@ jobs: strategy: matrix: include: + - tag: 'amazonlinux-2' + dockerfile: 'amazonlinux/2.Dockerfile' + platforms: 'linux/amd64' + - tag: 'amazonlinux-2023' dockerfile: 'amazonlinux/2023.Dockerfile' platforms: 'linux/amd64,linux/arm64' diff --git a/README.md b/README.md index 55c6fd5..2ff4eb1 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,7 @@ Docker containers that uses for Ansible role and playbook testing. Amazon Linux: +- `amazonlinux-2` (`linux/amd64`) - `amazonlinux-2023` (`linux/amd64`,`linux/arm64`) CentOS: diff --git a/amazonlinux/2.Dockerfile b/amazonlinux/2.Dockerfile new file mode 100644 index 0000000..94a0126 --- /dev/null +++ b/amazonlinux/2.Dockerfile @@ -0,0 +1,25 @@ +FROM amazonlinux:2 + +LABEL maintainer='Anton Melekhin' + +ENV container=docker + +RUN INSTALL_PKGS='findutils initscripts iproute python sudo' \ + && yum makecache fast && yum install -y $INSTALL_PKGS \ + \ + && curl --silent 'https://copr.fedorainfracloud.org/coprs/jsynacek/systemd-backports-for-centos-7/repo/epel-7/jsynacek-systemd-backports-for-centos-7-epel-7.repo' --output /etc/yum.repos.d/jsynacek-systemd-centos-7.repo \ + && yum update --disableplugin=priorities -y systemd \ + && yum makecache fast && yum update -y \ + && yum clean all + +RUN find /etc/systemd/system \ + /lib/systemd/system \ + -path '*.wants/*' \ + -not -name '*journald*' \ + -not -name '*systemd-tmpfiles*' \ + -not -name '*systemd-user-sessions*' \ + -print0 | xargs -0 rm -vf + +VOLUME [ "/sys/fs/cgroup" ] + +ENTRYPOINT [ "/usr/sbin/init" ] \ No newline at end of file