Skip to content
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

Fix hadolint errors #1048

Merged
merged 9 commits into from
Mar 8, 2023
Merged
30 changes: 17 additions & 13 deletions src/main/resources/ath-container/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,16 @@ RUN apt-get update && \

# Install a fixed firefox version that is known to work with the current selenium version, copied from https://hub.docker.com/r/selenium/node-firefox/dockerfile
ARG FIREFOX_VERSION=108.0.2
RUN apt-get -y install libgtk-3-0 libasound2 libdbus-glib-1-2 libx11-xcb-dev libpci-dev libgl1-mesa-glx wget bzip2 \
# hadolint: Do not pin packages as they are requirements only for firefox installation (and not ofr the rest of the ATH) and the effort required to track each version would be too huge
# hadolint ignore=DL3008
RUN apt-get -y --no-install-recommends install libgtk-3-0 libasound2 libdbus-glib-1-2 libx11-xcb-dev libpci-dev libgl1-mesa-glx wget bzip2 \
&& rm -rf /var/lib/apt/lists/* /var/cache/apt/* \
&& wget --no-verbose -O /tmp/firefox.tar.bz2 https://download-installer.cdn.mozilla.net/pub/firefox/releases/$FIREFOX_VERSION/linux-x86_64/en-US/firefox-$FIREFOX_VERSION.tar.bz2 \
&& curl --silent https://download-installer.cdn.mozilla.net/pub/firefox/releases/${FIREFOX_VERSION}/linux-x86_64/en-US/firefox-${FIREFOX_VERSION}.tar.bz2 --output /tmp/firefox.tar.bz2 \
&& rm -rf /opt/firefox \
&& tar -C /opt -xjf /tmp/firefox.tar.bz2 \
&& rm /tmp/firefox.tar.bz2 \
&& mv /opt/firefox /opt/firefox-$FIREFOX_VERSION \
&& ln -fs /opt/firefox-$FIREFOX_VERSION/firefox /usr/bin/firefox
&& mv /opt/firefox /opt/firefox-${FIREFOX_VERSION} \
&& ln -fs /opt/firefox-${FIREFOX_VERSION}/firefox /usr/bin/firefox

# Selenium needs a geckodriver in order to work properly
ENV GECKODRIVER_VERSION 0.32.2
Expand All @@ -67,21 +69,23 @@ RUN curl -ffSLO https://dlcdn.apache.org/maven/maven-3/$MAVEN_VERSION/binaries/a
ENV PATH="$PATH:/opt/maven/bin"

# Docker installation according to https://docs.docker.com/engine/install/ubuntu/
RUN mkdir -m 0755 -p /etc/apt/keyrings
RUN mkdir -p /etc/apt/keyrings && chmod 0755 /etc/apt/keyrings /etc/apt/ /etc
RUN curl -fsSL https://download.docker.com/linux/ubuntu/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg

RUN echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) stable" > /etc/apt/sources.list.d/docker.list

# Ensure that version is fixed
RUN echo " \
Package: docker-ce* \
Pin: version 5:23.0.1-1* \
Pin-Priority: 1001 \
" | tee /etc/apt/preferences.d/docker-ce

# Install pinned version
RUN apt-get update --quiet && apt-get install --yes --no-install-recommends docker-ce docker-ce-cli docker-buildx-plugin
ARG DOCKER_VERSION=23.0.1
ARG DOCKER_BUILDX_VERSION=0.10.2
RUN apt-get update --quiet \
&& apt-get install --yes --no-install-recommends \
docker-ce="5:${DOCKER_VERSION}*" \
docker-ce-cli="5:${DOCKER_VERSION}*" \
docker-buildx-plugin="${DOCKER_BUILDX_VERSION}*" \
&& apt-get clean \
&& rm -rf /var/cache/apt

ENV SHARED_DOCKER_SERVICE true

Expand Down