ploigos / ploigos-containers

Container image definitions for the Ploigos project.
GNU General Public License v3.0
7 stars 14 forks source link

Download GoLang and install #126

Closed jimmyliang-gov closed 2 weeks ago

jimmyliang-gov commented 2 weeks ago

Purpose

PR to fix the ploigos-tool-autogov image. The old image attempts to fetch and install golang via deprecated CentOS repo. The new approach is to download golang and install.

NOTE: This PR is to merge from a feature branch to the main branch within the ploigos/ploigos-containers project.

The previous PR (https://github.com/ploigos/ploigos-containers/pull/125) was to pull from a fork into a feature branch due to nuances with the CI build that was failing.

Breaking?

No

Integration Testing

Here is a successful build (with some debug RUN statements to get the go version):

STEP 10/20: RUN curl -L https://go.dev/dl/go${GOLANG_VERSION}.linux-amd64.tar.gz -o /tmp/golang.tar.gz && tar -C /usr/local -xzf /tmp/golang.tar.gz
/bin/sh: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8)
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0100 75 100 75 0 0 619 0 --:--:-- --:--:-- --:--:-- 619
83 65.7M 83 55.0M 0 0 123M 0 --:--:-- --:--:-- --:--:-- 123M100 65.7M 100 65.7M 0 0 132M 0 --:--:-- --:--:-- --:--:-- 209M
--> a5b72fa59a8
STEP 11/20: ENV PATH=$PATH:/usr/local/go/bin
--> 31eeb158087
STEP 12/20: ENV GOPATH=$HOME/go
--> a0cdab86bc4
STEP 13/20: ENV PATH=$PATH:$GOPATH/bin
--> 42a88dc6833
STEP 14/20: RUN which go
/bin/sh: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8)
/usr/local/go/bin/go
--> 98c20fc69f9
STEP 15/20: RUN go version
/bin/sh: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8)
go version go1.22.4 linux/amd64

Additionally, the autogov image locally was able to use go to build rekor successfully.