Skip to content

Commit b423937

Browse files
committed
Update aws, azure, gcp, and openwhisk go installation from official source and fix typo
1 parent 6882cf5 commit b423937

File tree

5 files changed

+144
-21
lines changed

5 files changed

+144
-21
lines changed

.dockerignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@ python-venv
88
regression-*
99
*_code
1010

11-
# ignore, will building docker image
11+
# ignore, while building docker image
1212
scylladb-volume/
Lines changed: 28 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,45 @@
11
ARG BASE_IMAGE
22
FROM ${BASE_IMAGE}
33

4+
# Define Go version as build argument with default
5+
ARG GO_VERSION=1.23.0
6+
ARG TARGETARCH=amd64
7+
48
#######################################
5-
# useradd, groupmod
6-
RUN yum install -y shadow-utils
9+
# Install required utilities
10+
RUN yum install -y shadow-utils wget ca-certificates tar zip
11+
12+
# Install gosu for running commands as another user
713
ENV GOSU_VERSION 1.14
814
# https://github.com/tianon/gosu/releases/tag/1.14
915
# key https://keys.openpgp.org/search?q=tianon%40debian.org
1016
RUN curl -o /usr/local/bin/gosu -SL "https://github.com/tianon/gosu/releases/download/${GOSU_VERSION}/gosu-amd64" \
1117
&& chmod +x /usr/local/bin/gosu
1218

19+
# Download and install Go
20+
RUN wget -q "https://go.dev/dl/go${GO_VERSION}.linux-${TARGETARCH}.tar.gz" -O go.tar.gz && \
21+
echo "Downloading Go ${GO_VERSION} for ${TARGETARCH}" && \
22+
# Remove any previous Go installation
23+
rm -rf /usr/local/go && \
24+
tar -C /usr/local -xzf go.tar.gz && \
25+
rm go.tar.gz
26+
27+
# Add Go to PATH permanently
28+
ENV PATH="/usr/local/go/bin:${PATH}"
1329

30+
# Verify installation
31+
RUN go version
32+
33+
# Set up SeBS environment
1434
RUN mkdir -p /sebs/
1535
COPY dockerfiles/golang_installer.sh /sebs/installer.sh
1636
COPY dockerfiles/entrypoint.sh /sebs/entrypoint.sh
17-
RUN chmod +x /sebs/entrypoint.sh
37+
RUN chmod +x /sebs/installer.sh /sebs/entrypoint.sh
1838

1939
# useradd and groupmod is installed in /usr/sbin which is not in PATH
20-
ENV PATH=/usr/sbin:$PATH
40+
ENV PATH=/usr/sbin:${PATH}
2141
ENV SCRIPT_FILE=/mnt/function/package.sh
22-
CMD /bin/bash /sebs/installer.sh
23-
ENTRYPOINT ["/sebs/entrypoint.sh"]
42+
43+
# Set the entry point and command
44+
ENTRYPOINT ["/sebs/entrypoint.sh"]
45+
CMD ["/bin/bash", "/sebs/installer.sh"]
Lines changed: 35 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,45 @@
11
ARG BASE_IMAGE
22
FROM ${BASE_IMAGE}
33

4-
RUN apt-get update\
5-
&& apt-get install -y --no-install-recommends zip gosu golang-1.23\
6-
&& apt-get purge -y --auto-remove
4+
# Define Go version as build argument with default
5+
ARG GO_VERSION=1.23.0
6+
ARG TARGETARCH=amd64
77

8+
# Install dependencies
9+
RUN apt-get update && \
10+
apt-get install -y --no-install-recommends \
11+
wget \
12+
ca-certificates \
13+
tar \
14+
zip \
15+
gosu \
16+
&& apt-get clean \
17+
&& rm -rf /var/lib/apt/lists/*
18+
19+
# Download and install Go
20+
RUN wget -q "https://go.dev/dl/go${GO_VERSION}.linux-${TARGETARCH}.tar.gz" -O go.tar.gz && \
21+
echo "Downloading Go ${GO_VERSION} for ${TARGETARCH}" && \
22+
# Remove any previous Go installation
23+
rm -rf /usr/local/go && \
24+
tar -C /usr/local -xzf go.tar.gz && \
25+
rm go.tar.gz
26+
27+
# Add Go to PATH permanently
28+
ENV PATH="/usr/local/go/bin:${PATH}"
29+
30+
# Verify installation
31+
RUN go version
32+
33+
# Set up SeBS environment
834
RUN mkdir -p /sebs/
935
COPY dockerfiles/golang_installer.sh /sebs/installer.sh
1036
COPY dockerfiles/entrypoint.sh /sebs/entrypoint.sh
11-
RUN chmod +x /sebs/entrypoint.sh
37+
RUN chmod +x /sebs/installer.sh /sebs/entrypoint.sh
1238

1339
# useradd and groupmod is installed in /usr/sbin which is not in PATH
14-
ENV PATH=/usr/sbin:$PATH
40+
ENV PATH=/usr/sbin:${PATH}
1541
ENV SCRIPT_FILE=/mnt/function/package.sh
16-
CMD /bin/bash /sebs/installer.sh
17-
ENTRYPOINT ["/sebs/entrypoint.sh"]
42+
43+
# Set the entry point and command
44+
ENTRYPOINT ["/sebs/entrypoint.sh"]
45+
CMD ["/bin/bash", "/sebs/installer.sh"]
Lines changed: 35 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,45 @@
11
ARG BASE_IMAGE
22
FROM ${BASE_IMAGE}
33

4-
RUN apt-get update\
5-
&& apt-get install -y --no-install-recommends zip gosu golang-1.23\
6-
&& apt-get purge -y --auto-remove
4+
# Define Go version as build argument with default
5+
ARG GO_VERSION=1.23.0
6+
ARG TARGETARCH=amd64
77

8+
# Install dependencies
9+
RUN apt-get update && \
10+
apt-get install -y --no-install-recommends \
11+
wget \
12+
ca-certificates \
13+
tar \
14+
zip \
15+
gosu \
16+
&& apt-get clean \
17+
&& rm -rf /var/lib/apt/lists/*
18+
19+
# Download and install Go
20+
RUN wget -q "https://go.dev/dl/go${GO_VERSION}.linux-${TARGETARCH}.tar.gz" -O go.tar.gz && \
21+
echo "Downloading Go ${GO_VERSION} for ${TARGETARCH}" && \
22+
# Remove any previous Go installation
23+
rm -rf /usr/local/go && \
24+
tar -C /usr/local -xzf go.tar.gz && \
25+
rm go.tar.gz
26+
27+
# Add Go to PATH permanently
28+
ENV PATH="/usr/local/go/bin:${PATH}"
29+
30+
# Verify installation
31+
RUN go version
32+
33+
# Set up SeBS environment
834
RUN mkdir -p /sebs/
935
COPY dockerfiles/golang_installer.sh /sebs/installer.sh
1036
COPY dockerfiles/entrypoint.sh /sebs/entrypoint.sh
11-
RUN chmod +x /sebs/entrypoint.sh
37+
RUN chmod +x /sebs/installer.sh /sebs/entrypoint.sh
1238

1339
# useradd and groupmod is installed in /usr/sbin which is not in PATH
14-
ENV PATH=/usr/sbin:$PATH
40+
ENV PATH=/usr/sbin:${PATH}
1541
ENV SCRIPT_FILE=/mnt/function/package.sh
16-
CMD /bin/bash /sebs/installer.sh
17-
ENTRYPOINT ["/sebs/entrypoint.sh"]
42+
43+
# Set the entry point and command
44+
ENTRYPOINT ["/sebs/entrypoint.sh"]
45+
CMD ["/bin/bash", "/sebs/installer.sh"]
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
ARG BASE_IMAGE
2+
FROM ${BASE_IMAGE}
3+
4+
# Define Go version as build argument with default
5+
ARG GO_VERSION=1.23.0
6+
ARG TARGETARCH=amd64
7+
8+
# Install dependencies
9+
RUN apt-get update && \
10+
apt-get install -y --no-install-recommends \
11+
wget \
12+
ca-certificates \
13+
tar \
14+
zip \
15+
gosu \
16+
&& apt-get clean \
17+
&& rm -rf /var/lib/apt/lists/*
18+
19+
# Download and install Go
20+
RUN wget -q "https://go.dev/dl/go${GO_VERSION}.linux-${TARGETARCH}.tar.gz" -O go.tar.gz && \
21+
echo "Downloading Go ${GO_VERSION} for ${TARGETARCH}" && \
22+
# Remove any previous Go installation
23+
rm -rf /usr/local/go && \
24+
tar -C /usr/local -xzf go.tar.gz && \
25+
rm go.tar.gz
26+
27+
# Add Go to PATH permanently
28+
ENV PATH="/usr/local/go/bin:${PATH}"
29+
30+
# Verify installation
31+
RUN go version
32+
33+
# Set up SeBS environment
34+
RUN mkdir -p /sebs/
35+
COPY dockerfiles/golang_installer.sh /sebs/installer.sh
36+
COPY dockerfiles/entrypoint.sh /sebs/entrypoint.sh
37+
RUN chmod +x /sebs/installer.sh /sebs/entrypoint.sh
38+
39+
# Add /usr/sbin to PATH (for useradd and groupmod)
40+
ENV PATH="/usr/sbin:${PATH}"
41+
ENV SCRIPT_FILE="/mnt/function/package.sh"
42+
43+
# Set the entry point and command
44+
ENTRYPOINT ["/sebs/entrypoint.sh"]
45+
CMD ["/bin/bash", "/sebs/installer.sh"]

0 commit comments

Comments
 (0)