Skip to content

Commit

Permalink
Fix alpine
Browse files Browse the repository at this point in the history
  • Loading branch information
fauust committed Dec 6, 2024
1 parent 3dfda80 commit 7cae468
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
1 change: 1 addition & 0 deletions .hadolint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ ignored:
- DL3008
- DL3018
- DL3041
- SC1091
12 changes: 10 additions & 2 deletions Dockerfile.alpine
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ ARG base_image=alpine:latest
FROM "$base_image"

RUN set -eux \
&& source /etc/os-release \
&& apk add --update --no-cache \
openrc \
&& sed -i 's/^\(tty\d\:\:\)/#\1/g' /etc/inittab \
Expand All @@ -18,8 +19,15 @@ RUN set -eux \
/etc/init.d/modules \
/etc/init.d/modules-load \
/etc/init.d/modloop \
&&sed -i 's/cgroup_add_service /# cgroup_add_service /g' /lib/rc/sh/openrc-run.sh \
&& sed -i 's/VSERVER/DOCKER/Ig' /lib/rc/sh/init.sh
&& if [ "$VERSION_ID" = "3.21*" ]; then \
OPENRC_RUN="/usr/libexec/rc/sh/openrc-run.sh"; \
INIT="/usr/libexec/rc/sh/init.sh"; \
else \
OPENRC_RUN="/lib/rc/sh/openrc-run.sh"; \
INIT="/lib/rc/sh/init.sh"; \
fi \
&& sed -i 's/cgroup_add_service /# cgroup_add_service /g' "$OPENRC_RUN" \
&& sed -i 's/VSERVER/DOCKER/Ig' "$INIT"

VOLUME ["/sys/fs/cgroup"]
CMD ["/sbin/init"]

0 comments on commit 7cae468

Please sign in to comment.