Skip to content

Commit bdbc4ec

Browse files
committed
build: add docker env var $ROOTFS
1 parent 2aeedc6 commit bdbc4ec

File tree

1 file changed

+16
-10
lines changed

1 file changed

+16
-10
lines changed

Dockerfile

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,12 @@ ENV S6_OVERLAY_VERSION="3.2.1.0"
109109
ENV S6_OVERLAY_ARCH="x86_64"
110110
ENV BASHIO_VERSION="0.16.2"
111111

112+
# #
113+
# ubuntu › environment
114+
# #
115+
116+
ENV ROOTFS=/root-out
117+
112118
# #
113119
# detect ubuntu version from distro
114120
# #
@@ -170,14 +176,14 @@ RUN \
170176
MULTIDIGEST=$(jq -r ".manifests[] | select(.platform.architecture == \"${UBUNTU_ARCH}\") | .digest[7:]" < ${DIGEST}) && \
171177
TARBALL=$(jq -r '.layers[0].digest[7:]' < ${MULTIDIGEST}); \
172178
fi && \
173-
mkdir /root-out && \
179+
mkdir $ROOTFS && \
174180
tar xf \
175181
${TARBALL} -C \
176-
/root-out && \
182+
$ROOTFS && \
177183
rm -rf \
178-
/root-out/var/log/* \
179-
/root-out/home/ubuntu \
180-
/root-out/root/{.ssh,.bashrc,.profile} \
184+
$ROOTFS/var/log/* \
185+
$ROOTFS/home/ubuntu \
186+
$ROOTFS/root/{.ssh,.bashrc,.profile} \
181187
/build
182188

183189
# #
@@ -212,13 +218,13 @@ RUN \
212218
fi \
213219
\
214220
&& wget -P /tmp "https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}/s6-overlay-noarch.tar.xz" && \
215-
tar -C /root-out -Jxpf /tmp/s6-overlay-noarch.tar.xz && \
221+
tar -C $ROOTFS -Jxpf /tmp/s6-overlay-noarch.tar.xz && \
216222
wget -P /tmp "https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}/s6-overlay-${S6_OVERLAY_ARCH}.tar.xz" && \
217-
tar -C /root-out -Jxpf /tmp/s6-overlay-${S6_OVERLAY_ARCH}.tar.xz && \
223+
tar -C $ROOTFS -Jxpf /tmp/s6-overlay-${S6_OVERLAY_ARCH}.tar.xz && \
218224
wget -P /tmp "https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}/s6-overlay-symlinks-arch.tar.xz" && \
219-
tar -C /root-out -Jxpf /tmp/s6-overlay-symlinks-arch.tar.xz && \
225+
tar -C $ROOTFS -Jxpf /tmp/s6-overlay-symlinks-arch.tar.xz && \
220226
wget -P /tmp "https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}/s6-overlay-symlinks-noarch.tar.xz" && \
221-
tar -C /root-out -Jxpf /tmp/s6-overlay-symlinks-noarch.tar.xz && unlink /root-out/usr/bin/with-contenv
227+
tar -C $ROOTFS -Jxpf /tmp/s6-overlay-symlinks-noarch.tar.xz && unlink $ROOTFS/usr/bin/with-contenv
222228

223229
# #
224230
# install bashio
@@ -236,7 +242,7 @@ RUN \
236242
# #
237243

238244
FROM scratch
239-
COPY --from=rootfs-stage /root-out/ /
245+
COPY --from=rootfs-stage $ROOTFS/ /
240246

241247
# #
242248
# scratch › args

0 commit comments

Comments
 (0)