gradle:8.6-jdk17 (ubuntu) CI/CD Development ImageThis image is maintained solely for use by myself in CI/CD pipelines. It's purpose is to pre-package environment variables and install tools i need to reduce runtime and Lines of Code.
Because they are inherently large in size, its recommended to use a dependency proxy:
- echo "$CI_DEPENDENCY_PROXY_PASSWORD" | docker login $CI_DEPENDENCY_PROXY_SERVER -u $CI_DEPENDENCY_PROXY_USER --password-stdin || echo "Failed to login to dependency proxy, continuing..."
Uses Multi-Stage Build to copy binaries and files from the following official images:
Sets Environment variables for GitLab Runner's Docker-in-Docker (tcp://docker:2376)
Installs Common Unix utilities from apt, including: curl, wget, git, openssl, wait-for-it, dos2unix, bc, netcat-openbsd, ripgrep, gettext, and build tools (build-essential, gcc, pkg-config, binutils). Upgrades all system packages for increased security. Does not clear update cache.
Installs Taskfile (task) - Simpler Make alternative to /usr/bin
Installs swaks - Swiss Army Knife for SMTP to /usr/bin
Installs Ruby, gem, and bundler - because some Asciidoctor Tools require it.
Installs nvm - because my project's arent node based, but some things require node, so CI does not have to fall back to starting node container just for one off thing
gradleprofiler): Installed via SDKMAN.asprof): Installed via Github Releases.
Configured proper non-root kernel parameters.
--cap-add SYS_ADMIN --security-opt seccomp=unconfinedARG BASE_IMAGE="gradle:8.6-jdk17-jammy"
FROM selenium/standalone-chrome AS chrome
FROM docker:27-cli AS docker-cli
FROM ${BASE_IMAGE:-ubuntu:latest}
## Common Features
ENV DEBIAN_FRONTEND=noninteractive
ENV LANG=C.UTF-8
ENV LC_ALL=C.UTF-8
# Enable e.g. 'source' and [[
SHELL ["/bin/bash", "-c"]
# Set up environment variables for Docker-in-Docker communication as per GitLab Runner
ENV DOCKER_HOST=tcp://docker:2376 \
DOCKER_TLS_CERTDIR=/certs \
DOCKER_TLS_VERIFY=1 \
DOCKER_CERT_PATH=/certs/client
# Add docker binary and optional supporting files from the docker-cli image
COPY --from=docker-cli /usr/local/bin/docker /usr/local/bin/docker
COPY --from=docker-cli /usr/local/libexec/docker /usr/local/libexec/docker
# Add Chrome support
COPY --from=chrome /opt/selenium /opt/selenium
COPY --from=chrome /usr/bin/google-chrome /usr/bin/google-chrome
COPY --from=chrome /usr/bin/google-chrome /usr/bin/chromedriver
# choose fastest mirror (https://www.baeldung.com/linux/apt-terminal-choose-fastest-mirror)
RUN source /etc/os-release && \
if [[ "$ID" == "ubuntu" ]]; then \
sed -iv "s|deb [a-z]*://[^ ]* |deb mirror://mirrors.ubuntu.com/mirrors.txt |g" /etc/apt/sources.list; \
fi;
# (Deliberately not removing apt cache)
RUN apt-get -qy update && apt-get -qy upgrade && apt-get -qy autoremove
RUN apt-get -qy install tzdata
# Install common Unix utilities
RUN apt-get -qy install curl tar zip unzip wget sed recode dos2unix rpl grep coreutils rsync git jq build-essential util-linux net-tools tree dnsutils iputils-ping
# Install useful CI tools
RUN apt-get -qy install openssl bc netcat-openbsd wait-for-it ripgrep gettext gcc pkg-config binutils
RUN apt-get -qqy install bat nano iproute2 || true
# Install "SMTP Swiss Army Knife"
RUN (curl -L https://jetmore.org/john/code/swaks/files/swaks-20240103.0/swaks -o /usr/bin/swaks && chmod 755 /usr/bin/swaks) || apt-get install -qy swaks
# Install Taskfile
RUN sh -c "$(curl --location https://taskfile.dev/install.sh)" -- -d -b /usr/bin
# Install Ruby, gem, and Bundler
RUN apt-get -qy install ruby && gem install bundler
# https://github.com/ruby/bigdecimal/issues/297 - fix bigdecimal install error
RUN apt-get -qy install libjemalloc-dev libgmp-dev libz-dev clang
# Install Node Version Manager
ENV NVM_DIR=/root/.nvm
RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/master/install.sh | bash
COPY gradle.properties "${GRADLE_HOME}/gradle.properties"
# Install SDKMAN
RUN curl -s -S -o ./get-sdkman.sh "https://get.sdkman.io?rcupdate=false" \
&& chmod +x ./get-sdkman.sh \
&& ./get-sdkman.sh \
&& rm ./get-sdkman.sh \
# Change SDKMAN's config to be suitable for a CI pipeline execution
&& sed -i 's/sdkman_auto_answer=false/sdkman_auto_answer=true/g' $HOME/.sdkman/etc/config \
&& sed -i 's/sdkman_selfupdate_feature=true/sdkman_selfupdate_feature=false/g' $HOME/.sdkman/etc/config \
&& sed -i 's/sdkman_colour_enable=true/sdkman_colour_enable=false/g' $HOME/.sdkman/etc/config
ENV BASH_ENV="\$HOME/.sdkman/bin/sdkman-init.sh"
# https://github.com/async-profiler/async-profiler/blob/master/docs/GettingStarted.md
RUN sysctl kernel.perf_event_paranoid=1
RUN sysctl kernel.kptr_restrict=0
ADD https://github.com/async-profiler/async-profiler/releases/download/v4.0/async-profiler-4.0-linux-x64.tar.gz /tmp/async-profiler.tar.gz
RUN mkdir -p /usr/local/async-profiler && \
tar -xzvf /tmp/async-profiler.tar.gz --strip-components=1 -C /usr/local/async-profiler && \
ln -sf /usr/local/async-profiler/bin/asprof /usr/local/bin/asprof && \
/usr/local/bin/asprof --version
# https://github.com/gradle/gradle-profiler
RUN /bin/bash -c "sdk install gradleprofiler"
Content type
Image
Digest
sha256:2e86adb9f…
Size
934.3 MB
Last updated
8 months ago
docker pull jonaspammerwork/gradle