From 3ce111504e95d18c9f3588ae5427c36d4aa3be8b Mon Sep 17 00:00:00 2001 From: "Ryan (hackercat)" Date: Tue, 22 Jun 2021 07:54:33 +0000 Subject: [PATCH] fix: match `PATH=` only (#15) --- linux/ubuntu/act/Dockerfile | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/linux/ubuntu/act/Dockerfile b/linux/ubuntu/act/Dockerfile index a7e33b2..db8d08b 100644 --- a/linux/ubuntu/act/Dockerfile +++ b/linux/ubuntu/act/Dockerfile @@ -14,9 +14,10 @@ ARG NODE_VERSION=12 # > Distro ARG DISTRO=ubuntu +ARG TYPE=act # > Force apt to not be interactive/not ask -ARG DEBIAN_FRONTEND=noninteractive +ENV DEBIAN_FRONTEND=noninteractive SHELL [ "/bin/bash", "--noprofile", "--norc", "-e", "-o", "pipefail", "-c" ] @@ -55,16 +56,16 @@ RUN set -Eeuxo pipefail \ && apt-get -yq update \ && apt-get -yq install --no-install-recommends moby-cli moby-buildx \ && printf "\n\n\tšŸ‹ Installed moby-cli šŸ‹\t\n\n" \ - && docker version \ + && docker -v \ && printf "\n\n\tšŸ‹ Installed moby-buildx šŸ‹\t\n\n" \ && docker buildx version \ && printf "\n\n\tšŸ‹ Installing Node.JS šŸ‹\t\n\n" \ - && ver=$(curl https://nodejs.org/download/release/index.json | jq "[.[] | select(.version|test(\"^v${NODE_VERSION}\"))][0].version" -r) \ - && node_path=$AGENT_TOOLSDIRECTORY/node/$(echo $ver | sed 's/v//g')/x64 \ - && mkdir -v -m 0777 -p $node_path \ - && curl "https://nodejs.org/download/release/latest-v${NODE_VERSION}.x/node-${ver}-linux-x64.tar.xz" | tar -Jxf - --strip-components=1 -C $node_path \ - && sed "s|PATH=|PATH=${node_path}/bin:|g" -i /etc/environment \ - && export PATH="${node_path}/bin:$PATH" \ + && VER=$(curl https://nodejs.org/download/release/index.json | jq "[.[] | select(.version|test(\"^v${NODE_VERSION}\"))][0].version" -r) \ + && NODEPATH="$AGENT_TOOLSDIRECTORY/node/${VER:1}/x64" \ + && mkdir -v -m 0777 -p $NODEPATH \ + && curl "https://nodejs.org/download/release/latest-v${NODE_VERSION}.x/node-$VER-linux-x64.tar.xz" | tar -Jxf - --strip-components=1 -C $NODEPATH \ + && sed "s|^PATH=|PATH=$NODEPATH/bin:|mg" -i /etc/environment \ + && export PATH="$NODEPATH/bin:$PATH" \ && printf "\n\n\tšŸ‹ Installed Node.JS $(node -v) šŸ‹\t\n\n" \ && printf "\n\n\tšŸ‹ Installed NPM $(npm -v) šŸ‹\t\n\n" \ && printf "\n\n\tšŸ‹ Cleaning image šŸ‹\t\n\n" \ @@ -78,7 +79,7 @@ ARG BUILD_REF="master" LABEL org.opencontainers.image.vendor="catthehacker" LABEL org.opencontainers.image.authors="me@hackerc.at" -LABEL org.opencontainers.image.url="https://github.com/catthehacker/docker_images/tree/${BUILD_REF}/linux/${DISTRO}/${BUILD_TAG}/" +LABEL org.opencontainers.image.url="https://github.com/catthehacker/docker_images/tree/${BUILD_REF}/linux/${DISTRO}/${TYPE}/" LABEL org.opencontainers.image.source="https://github.com/catthehacker/docker_images" LABEL org.opencontainers.image.version=${BUILD_TAG_VERSION} LABEL org.opencontainers.image.title=${BUILD_TAG}-${TARGETARCH}