From ba8be57eef536ed60f53eda73a5777d69d8f282f Mon Sep 17 00:00:00 2001 From: Magnus Skjegstad Date: Wed, 5 Jul 2017 16:40:25 +0200 Subject: [PATCH] pkg: add acpid Adds a new service for running `/sbin/acpid` that comes with busybox. The VM will shut down if the power button is pressed. Signed-off-by: Magnus Skjegstad --- pkg/acpid/Dockerfile | 22 ++++++++++++++++++++++ pkg/acpid/Makefile | 3 +++ 2 files changed, 25 insertions(+) create mode 100644 pkg/acpid/Dockerfile create mode 100644 pkg/acpid/Makefile diff --git a/pkg/acpid/Dockerfile b/pkg/acpid/Dockerfile new file mode 100644 index 000000000..7104c92f5 --- /dev/null +++ b/pkg/acpid/Dockerfile @@ -0,0 +1,22 @@ +FROM linuxkit/alpine:2e362f4459ba4491655061cccdd2fcc7a2de5eb3 AS mirror + +RUN mkdir -p /out/etc/apk && cp -r /etc/apk/* /out/etc/apk/ +RUN apk add --no-cache --initdb -p /out \ + alpine-baselayout \ + busybox +RUN rm -rf /out/etc/apk /out/lib/apk /out/var/cache + +FROM linuxkit/alpine:2e362f4459ba4491655061cccdd2fcc7a2de5eb3 AS mirror2 +RUN mkdir -p /out/etc/apk && cp -r /etc/apk/* /out/etc/apk/ +RUN apk add --no-cache --initdb -p /out \ + busybox-initscripts +RUN rm -rf /out/etc/apk /out/lib/apk /out/var/cache + +FROM scratch +COPY --from=mirror /out/ / +COPY --from=mirror2 /out/etc/acpi /etc/acpi + +CMD ["/sbin/acpid", "-f", "-d"] + +LABEL org.mobyproject.config='{"binds": ["/dev:/dev"], "pid": "host"}' + diff --git a/pkg/acpid/Makefile b/pkg/acpid/Makefile new file mode 100644 index 000000000..5abb21c70 --- /dev/null +++ b/pkg/acpid/Makefile @@ -0,0 +1,3 @@ +IMAGE=acpid + +include ../package.mk