Set osImage for docker image

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
This commit is contained in:
Brad Davidson 2021-08-20 15:19:16 -07:00 committed by Brad Davidson
parent 156bae2940
commit 58315fe135
2 changed files with 5 additions and 3 deletions

View File

@ -9,10 +9,12 @@ RUN cd image/bin && \
ln -s k3s-server k3s
FROM scratch
ARG VERSION="dev"
COPY --from=base /image /
RUN mkdir -p /etc && \
echo 'hosts: files dns' > /etc/nsswitch.conf
RUN chmod 1777 /tmp
echo 'hosts: files dns' > /etc/nsswitch.conf && \
echo "PRETTY_NAME=\"K3s ${VERSION}\"" > /etc/os-release && \
chmod 1777 /tmp
VOLUME /var/lib/kubelet
VOLUME /var/lib/rancher/k3s
VOLUME /var/lib/cni

View File

@ -14,6 +14,6 @@ PROXY_OPTS=
[ -z "$http_proxy" ] || PROXY_OPTS="$PROXY_OPTS --build-arg http_proxy=$http_proxy"
[ -z "$https_proxy" ] || PROXY_OPTS="$PROXY_OPTS --build-arg https_proxy=$https_proxy"
[ -z "$no_proxy" ] || PROXY_OPTS="$PROXY_OPTS --build-arg no_proxy=$no_proxy"
docker build ${PROXY_OPTS} -t ${IMAGE} -f package/Dockerfile .
docker build ${PROXY_OPTS} --build-arg VERSION=${VERSION} -t ${IMAGE} -f package/Dockerfile .
./scripts/image_scan.sh ${IMAGE}
echo Built ${IMAGE}