Skip to content

Commit

Permalink
feat: add amazonlinux/2.Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
antmelekhin committed Aug 24, 2024
1 parent c73df2a commit 897e322
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/build-and-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
25 changes: 25 additions & 0 deletions amazonlinux/2.Dockerfile
Original file line number Diff line number Diff line change
@@ -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" ]

0 comments on commit 897e322

Please sign in to comment.