mirror of
https://git.vectorsigma.ru/public/k3s.git
synced 2026-07-29 00:39:30 +00:00
Fix OS PRETTY_NAME on tagged releases
These were always showing up as dev due to the build arg not being set by the drone step.
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit eae221f9e5)
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
This commit is contained in:
committed by
Brad Davidson
parent
bbcf71315b
commit
29e1361254
@@ -99,6 +99,8 @@ steps:
|
||||
repo: "rancher/k3s"
|
||||
username:
|
||||
from_secret: docker_username
|
||||
build_args_from_env:
|
||||
- DRONE_TAG
|
||||
when:
|
||||
instance:
|
||||
- drone-publish.k3s.io
|
||||
@@ -264,6 +266,8 @@ steps:
|
||||
repo: "rancher/k3s"
|
||||
username:
|
||||
from_secret: docker_username
|
||||
build_args_from_env:
|
||||
- DRONE_TAG
|
||||
when:
|
||||
instance:
|
||||
- drone-publish.k3s.io
|
||||
@@ -370,6 +374,8 @@ steps:
|
||||
repo: "rancher/k3s"
|
||||
username:
|
||||
from_secret: docker_username
|
||||
build_args_from_env:
|
||||
- DRONE_TAG
|
||||
when:
|
||||
instance:
|
||||
- drone-publish.k3s.io
|
||||
@@ -487,7 +493,6 @@ steps:
|
||||
- DOCKER_USERNAME
|
||||
- DOCKER_PASSWORD
|
||||
- DRONE_TAG
|
||||
|
||||
trigger:
|
||||
instance:
|
||||
- drone-publish.k3s.io
|
||||
|
||||
@@ -5,14 +5,17 @@ RUN mkdir -p /image/etc/ssl/certs /image/run /image/var/run /image/tmp /image/li
|
||||
tar -xa -C /image -f /data.tar.zst && \
|
||||
cp /etc/ssl/certs/ca-certificates.crt /image/etc/ssl/certs/ca-certificates.crt
|
||||
|
||||
FROM scratch
|
||||
ARG VERSION="dev"
|
||||
FROM scratch as collect
|
||||
ARG DRONE_TAG="dev"
|
||||
COPY --from=base /image /
|
||||
COPY --from=base /usr/share/zoneinfo /usr/share/zoneinfo
|
||||
RUN mkdir -p /etc && \
|
||||
echo 'hosts: files dns' > /etc/nsswitch.conf && \
|
||||
echo "PRETTY_NAME=\"K3s ${VERSION}\"" > /etc/os-release && \
|
||||
echo "PRETTY_NAME=\"K3s ${DRONE_TAG}\"" > /etc/os-release && \
|
||||
chmod 1777 /tmp
|
||||
|
||||
FROM scratch
|
||||
COPY --from=collect / /
|
||||
VOLUME /var/lib/kubelet
|
||||
VOLUME /var/lib/rancher/k3s
|
||||
VOLUME /var/lib/cni
|
||||
|
||||
@@ -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} --build-arg VERSION=${VERSION} -t ${IMAGE} -f package/Dockerfile .
|
||||
docker build ${PROXY_OPTS} --build-arg DRONE_TAG=${VERSION_TAG} -t ${IMAGE} -f package/Dockerfile .
|
||||
./scripts/image_scan.sh ${IMAGE} ${ARCH}
|
||||
echo Built ${IMAGE}
|
||||
|
||||
Reference in New Issue
Block a user