Skip to content

CASSANDRA-20687 added Go into ubuntu2004_j11.docker #116

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 2, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 21 additions & 1 deletion docker/testing/ubuntu2004_j11.docker
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
# limitations under the License.

FROM ubuntu:20.04
MAINTAINER Apache Cassandra <[email protected]>
LABEL org.opencontainers.image.authors="Apache Cassandra <[email protected]>"

# configure apt to retry downloads
RUN echo 'APT::Acquire::Retries "99";' > /etc/apt/apt.conf.d/80-retries
Expand Down Expand Up @@ -84,6 +84,7 @@ RUN pip3 install --upgrade wheel
# openjdk + ant
RUN export DEBIAN_FRONTEND=noninteractive && \
apt-get update && \
apt-get install -y ca-certificates-java && \
apt-get install -y --no-install-recommends openjdk-8-jdk openjdk-11-jdk openjdk-17-jdk ant ant-optional

# make Java 8 the default executable (we use to run all tests against Java 8)
Expand All @@ -104,6 +105,25 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
# fix up permissions on the cassandra home dir
RUN chown -R cassandra:cassandra /home/cassandra

# install golang. GO_VERSION_SHA must be updated with VERSION
RUN sh -c '\
GO_VERSION="1.24.3" ;\
GO_VERSION_SHAS="3333f6ea53afa971e9078895eaa4ac7204a8c6b5c68c10e6bc9a33e8e391bdd8 a463cb59382bd7ae7d8f4c68846e73c4d589f223c589ac76871b66811ded7836 13e6fe3fcf65689d77d40e633de1e31c6febbdbcb846eb05fc2434ed2213e92b 64a3fa22142f627e78fac3018ce3d4aeace68b743eff0afda8aae0411df5e4fb" ;\
GO_OS=linux ;\
[ $(uname) = "Darwin" ] && GO_OS=darwin ;\
GO_PLATFORM=amd64 ;\
[ $(uname -m) = "aarch64" ] && GO_PLATFORM=arm64 ;\
GO_TAR="go${GO_VERSION}.${GO_OS}-${GO_PLATFORM}.tar.gz" ;\
curl -L --fail --silent --retry 2 --retry-delay 5 --max-time 30 https://go.dev/dl/$GO_TAR -o $GO_TAR ;\
GO_SHA="$(sha256sum $GO_TAR | cut -d" " -f2)" ;\
echo "$GO_VERSION_SHAS" | sed "s/ /\n/g" | grep -q "$GO_SHA" || { echo "SHA256 mismatch for $GO_TAR $GO_SHA"; exit 1; } ;\
tar -C /usr/local -xzf $GO_TAR ;\
rm $GO_TAR'

ENV GOROOT="/usr/local/go"
ENV GOPATH="/home/cassandra/go"
ENV PATH="$PATH:/usr/local/go/bin"

# switch to the cassandra user... we are all done running things as root
USER cassandra
ENV HOME /home/cassandra
Expand Down
7 changes: 5 additions & 2 deletions docker/testing/ubuntu2004_j11_w_dependencies.docker
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@

# base things off the testing image without dependencies warmed up
FROM apache/cassandra-testing-ubuntu2004-java11
MAINTAINER Apache Cassandra <[email protected]>
LABEL org.opencontainers.image.authors="Apache Cassandra <[email protected]>"

USER cassandra
ENV HOME /home/cassandra
ENV HOME=/home/cassandra
WORKDIR /home/cassandra

# Fetch the maven dependencies in advance since this tends to fail at runtime
Expand Down Expand Up @@ -47,7 +47,9 @@ RUN cd ~/cassandra && \
git checkout origin/cassandra-2.1 && ant maven-ant-tasks-retrieve-build

# Initialize the CCM git repo as well as this also can fail to clone
RUN rm -fr ~/.ccm/repository/_git_cache_apache
RUN /bin/bash -c 'source ~/env3.6/bin/activate && \
export LC_ALL=en_US.UTF-8 && export LANG=en_US.UTF-8 && export LANGUAGE=en_US.UTF-8 && \
ccm create -n 1 -v git:cassandra-4.1 test && ccm remove test && \
ccm create -n 1 -v git:cassandra-4.0 test && ccm remove test && \
ccm create -n 1 -v git:cassandra-3.11 test && ccm remove test && \
Expand All @@ -72,3 +74,4 @@ RUN bash -c 'source ~/env3.6/bin/activate && \
latest_4_1=$(curl -s https://downloads.apache.org/cassandra/ | grep -oP "(?<=href=\")4\.1\.[0-9]+(?=\")" | sort -V | tail -1 | cut -d"." -f3) && \
for i in $(seq 1 $latest_4_1); do echo $i ; ccm create --quiet -n 1 -v binary:4.1.$i test && ccm remove test ; done'

RUN rm -rf ~/env*/src/cassandra-driver/.git /tmp/ccm-*.tar.gz