Skip to content

Commit

Permalink
feat: add fedora support
Browse files Browse the repository at this point in the history
  • Loading branch information
antmelekhin committed Jul 6, 2024
1 parent 7e46c60 commit 44cba2c
Show file tree
Hide file tree
Showing 4 changed files with 80 additions and 1 deletion.
10 changes: 9 additions & 1 deletion .github/workflows/build-and-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
include:
- tag: 'amazonlinux-2023'
dockerfile: 'amazonlinux/2023.Dockerfile'
platforms: 'linux/amd64, linux/arm64'
platforms: 'linux/amd64,linux/arm64'

- tag: 'centos-7'
dockerfile: 'centos/7.Dockerfile'
Expand All @@ -36,6 +36,14 @@ jobs:
dockerfile: 'debian/12.Dockerfile'
platforms: 'linux/amd64,linux/arm64'

- tag: 'fedora-39'
dockerfile: 'debian/39.Dockerfile'
platforms: 'linux/amd64,linux/arm64'

- tag: 'fedora-40'
dockerfile: 'debian/40.Dockerfile'
platforms: 'linux/amd64,linux/arm64'

- tag: 'rockylinux-8'
dockerfile: 'rockylinux/8.Dockerfile'
platforms: 'linux/amd64,linux/arm64'
Expand Down
29 changes: 29 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ Debian:
- `debian-11` (`linux/amd64`,`linux/arm64`)
- `debian-12` (`linux/amd64`,`linux/arm64`)

Fedora:

- `fedora-39` (`linux/amd64`,`linux/arm64`)
- `fedora-40` (`linux/amd64`,`linux/arm64`)

Rocky Linux:

- `rockylinux-8` (`linux/amd64`,`linux/arm64`)
Expand All @@ -31,6 +36,8 @@ Ubuntu:

## Usage

### With Molecule

```yaml
---
dependency:
Expand Down Expand Up @@ -65,6 +72,28 @@ verifier:
name: 'ansible'
```

### Build and run

- Build the image with `Ubuntu 22.04`

```bash
export DISTR='ubuntu'
export VERSION='22.04'
docker build -t docker-systemd:${DISTR}-${VERSION} -f ${DISTR}/${VERSION}.Dockerfile .
```

- Run the container

```bash
docker run -d --name systemd-${DISTR}-${VERSION} --privileged -v /sys/fs/cgroup:/sys/fs/cgroup:rw --cgroupns=host docker-systemd:${DISTR}-${VERSION}
```

- Enter to the container

```bash
docker exec -it systemd-${DISTR}-${VERSION} /bin/bash
```

## License

MIT
Expand Down
21 changes: 21 additions & 0 deletions fedora/39.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
FROM fedora:39

LABEL maintainer='Anton Melekhin'

ENV container=docker

RUN INSTALL_PKGS='findutils initscripts iproute python3 sudo' \
&& dnf makecache && dnf install -y $INSTALL_PKGS \
&& dnf 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" ]
21 changes: 21 additions & 0 deletions fedora/40.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
FROM fedora:40

LABEL maintainer='Anton Melekhin'

ENV container=docker

RUN INSTALL_PKGS='findutils initscripts iproute python3 sudo' \
&& dnf makecache && dnf install -y $INSTALL_PKGS \
&& dnf 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 44cba2c

Please sign in to comment.