mirror of https://github.com/k3s-io/k3s
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>
pull/9217/head
parent
3d4216ca46
commit
1f27e2f80e
|
@ -102,6 +102,8 @@ steps:
|
|||
repo: "rancher/k3s"
|
||||
username:
|
||||
from_secret: docker_username
|
||||
build_args_from_env:
|
||||
- DRONE_TAG
|
||||
when:
|
||||
instance:
|
||||
- drone-publish.k3s.io
|
||||
|
@ -270,6 +272,8 @@ steps:
|
|||
repo: "rancher/k3s"
|
||||
username:
|
||||
from_secret: docker_username
|
||||
build_args_from_env:
|
||||
- DRONE_TAG
|
||||
when:
|
||||
instance:
|
||||
- drone-publish.k3s.io
|
||||
|
@ -379,6 +383,8 @@ steps:
|
|||
repo: "rancher/k3s"
|
||||
username:
|
||||
from_secret: docker_username
|
||||
build_args_from_env:
|
||||
- DRONE_TAG
|
||||
when:
|
||||
instance:
|
||||
- drone-publish.k3s.io
|
||||
|
@ -496,7 +502,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}
|
||||
|
|
Loading…
Reference in New Issue