From ad1100c050ab9236a5d5efa72b2706940945833f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Janne=20Kiiskil=C3=A4?= Date: Mon, 8 Jul 2024 13:17:55 +0300 Subject: [PATCH 1/2] Update edge-proxy (1.4.0) and pe-terminanal (1.2.0) This requires then changes to Dockerfile: Version 27.03 of docker does not seem to take the line 3 and 4 in anymore as previously, it ignores them. This made the build fail ``` 2 warnings found (use --debug to expand): - UndefinedVar: Usage of undefined variable '$http_proxy' (line 19) - UndefinedVar: Usage of undefined variable '$https_proxy' (line 20) ``` We also had one mixed capital usage with FROM and as -< AS needs to be in capital as well. Install golang 1.20 as it's needed with updated pe-terminal and edge-proxy - they are golang 1.20 based instead of 1.18. --- Dockerfile | 12 +++++++----- snap/snapcraft.yaml | 8 ++++---- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/Dockerfile b/Dockerfile index 4b1272ab..19640ad6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,7 @@ ARG RISK=stable ARG UBUNTU=20.04 -ARG http_proxy="" -ARG https_proxy="" +#ARG http_proxy="" +#ARG https_proxy="" # Based on Docker image at; # https://raw.githubusercontent.com/snapcore/snapcraft/master/docker/Dockerfile # Update to focal + merged in what we had originally here. @@ -11,13 +11,13 @@ ARG https_proxy="" # ARG https_proxy="https://:@:" # Use the proxy from docker build for the container runtime environment as well -FROM ubuntu:$UBUNTU as builder +FROM ubuntu:$UBUNTU AS builder ARG RISK ARG UBUNTU RUN echo "Building snapcraft:$RISK in ubuntu:$UBUNTU" -ENV http_proxy=$http_proxy -ENV https_proxy=$https_proxy +ENV http_proxy="" +ENV https_proxy="" # Grab dependencies RUN apt-get update @@ -125,6 +125,8 @@ RUN curl -L https://dl.google.com/go/go1.15.15.linux-amd64.tar.gz | tar -xz && \ RUN curl -L https://golang.org/dl/go1.18.10.linux-amd64.tar.gz | tar -xz && \ mv go /usr/local/go1.18 +RUN curl -L https://golang.org/dl/go1.20.14.linux-amd64.tar.gz | tar -xz && \ + mv go /usr/local/go1.20 # Install the script that sets up the user environment # and runs CMD as the current user instead of as root diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml index 27283b25..4a8e77c4 100644 --- a/snap/snapcraft.yaml +++ b/snap/snapcraft.yaml @@ -515,11 +515,11 @@ parts: edge-proxy: plugin: go source: https://github.com/PelionIoT/edge-proxy.git - source-tag: v1.3.0 + source-tag: v1.4.0 build-environment: - GOFLAGS: "$GOFLAGS -modcacherw" override-build: | - export ALT_GO=go1.18 + export ALT_GO=go1.20 export ORI_GO=go1.15 export GOROOT=/usr/local/$ALT_GO export PATH="$GOROOT/bin:$PATH" @@ -545,11 +545,11 @@ parts: pe-terminal: plugin: go source: https://github.com/PelionIoT/pe-terminal.git - source-tag: v1.1.0 + source-tag: v1.2.0 build-environment: - GOFLAGS: "$GOFLAGS -modcacherw" override-build: | - export ALT_GO=go1.18 + export ALT_GO=go1.20 export ORI_GO=go1.15 export GOROOT=/usr/local/$ALT_GO export PATH="$GOROOT/bin:$PATH" From 61ac85d038759b3039fda170279b1eda69351bb7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Janne=20Kiiskil=C3=A4?= Date: Mon, 19 Aug 2024 16:42:09 +0300 Subject: [PATCH 2/2] Dockerfile - remove #ARGs They are not adding value, the ARG for http proxy is documented a few lines below them anyway. Ref: review feedback from Pete. --- Dockerfile | 2 -- 1 file changed, 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 19640ad6..fa05d414 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,5 @@ ARG RISK=stable ARG UBUNTU=20.04 -#ARG http_proxy="" -#ARG https_proxy="" # Based on Docker image at; # https://raw.githubusercontent.com/snapcore/snapcraft/master/docker/Dockerfile # Update to focal + merged in what we had originally here.