Skip to content

Commit

Permalink
QD-4594 Unify multiple images for better caches
Browse files Browse the repository at this point in the history
  • Loading branch information
tiulpin committed Sep 4, 2023
1 parent 206c8b1 commit ed52b27
Show file tree
Hide file tree
Showing 10 changed files with 43 additions and 43 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,5 @@ jobs:
context: ${{ matrix.version }}/${{ matrix.linter }}
platforms: ${{ matrix.platform }}
push: false
cache-from: type=gha
cache-to: type=gha,mode=max
4 changes: 2 additions & 2 deletions 2023.2/android-community/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ ENV HOME="/root" \
QODANA_DATA="/data" \
QODANA_DOCKER="true"
ENV JAVA_HOME="$QODANA_DIST/jbr" \
QODANA_CONF="$HOME/.config/idea"
ENV PATH="$QODANA_DIST/bin:$PATH"
QODANA_CONF="$HOME/.config/idea" \
PATH="$QODANA_DIST/bin:$PATH"

# hadolint ignore=SC2174
RUN mkdir -m 777 -p /opt $QODANA_DATA $QODANA_CONF && apt-get update && \
Expand Down
6 changes: 3 additions & 3 deletions 2023.2/dotnet/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ ENV HOME="/root" \
QODANA_DATA="/data" \
QODANA_DOCKER="true"
ENV JAVA_HOME="$QODANA_DIST/jbr" \
QODANA_CONF="$HOME/.config/idea"
QODANA_CONF="$HOME/.config/idea" \
PATH="$QODANA_DIST/bin:$PATH"

ENV RIDER_UNREAL_ROOT="/data/unrealEngine" DOTNET_ROOT="/usr/share/dotnet"

Expand All @@ -19,8 +20,6 @@ ARG DOTNET_INSTALL_SH_REVISION="40434288dc5bbda41eafcbcbbc5c0fbbe028fb30"
ARG DOTNET_CHANNEL_A="7.0"
ARG DOTNET_CHANNEL_B="6.0"

ENV PATH="$QODANA_DIST/bin:/opt/yarn/bin:$PATH"

# hadolint ignore=SC2174
RUN mkdir -m 777 -p $QODANA_DATA $QODANA_CONF $DOTNET_ROOT $RIDER_UNREAL_ROOT && apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
Expand Down Expand Up @@ -48,6 +47,7 @@ RUN mkdir -m 777 -p $QODANA_DATA $QODANA_CONF $DOTNET_ROOT $RIDER_UNREAL_ROOT &&
chmod 777 -R $DOTNET_ROOT && \
rm -rf /var/cache/apt /var/lib/apt/ /tmp/*

ENV PATH="/opt/yarn/bin:$PATH"
COPY --from=node_base /usr/local/bin/node /usr/local/bin/
COPY --from=node_base /usr/local/include/node /usr/local/include/node
COPY --from=node_base /usr/local/lib/node_modules /usr/local/lib/node_modules
Expand Down
6 changes: 3 additions & 3 deletions 2023.2/go/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,8 @@ ENV HOME="/root" \
QODANA_DATA="/data" \
QODANA_DOCKER="true"
ENV JAVA_HOME="$QODANA_DIST/jbr" \
QODANA_CONF="$HOME/.config/idea"

ENV PATH="$QODANA_DIST/bin:/opt/yarn/bin:$PATH"
QODANA_CONF="$HOME/.config/idea"\
PATH="$QODANA_DIST/bin:$PATH"

# hadolint ignore=SC2174
RUN mkdir -m 777 -p /opt $QODANA_DATA $QODANA_CONF && apt-get update && \
Expand All @@ -32,6 +31,7 @@ RUN mkdir -m 777 -p /opt $QODANA_DATA $QODANA_CONF && apt-get update && \
git config --global --add safe.directory '*' && \
rm -rf /var/cache/apt /var/lib/apt/ /tmp/*

ENV PATH="/opt/yarn/bin:$PATH"
COPY --from=node_base /usr/local/bin/node /usr/local/bin/
COPY --from=node_base /usr/local/include/node /usr/local/include/node
COPY --from=node_base /usr/local/lib/node_modules /usr/local/lib/node_modules
Expand Down
7 changes: 4 additions & 3 deletions 2023.2/js/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@ ENV HOME="/root" \
QODANA_DATA="/data" \
QODANA_DOCKER="true"
ENV JAVA_HOME="$QODANA_DIST/jbr" \
QODANA_CONF="$HOME/.config/idea"

ENV PATH="$QODANA_DIST/bin:/opt/yarn/bin:$PATH"
QODANA_CONF="$HOME/.config/idea" \
PATH="$QODANA_DIST/bin:$PATH"

# hadolint ignore=SC2174
RUN mkdir -m 777 -p /opt $QODANA_DATA $QODANA_CONF && apt-get update && \
Expand All @@ -31,6 +30,8 @@ RUN mkdir -m 777 -p /opt $QODANA_DATA $QODANA_CONF && apt-get update && \
chmod 777 -R "$HOME/.npm" "$HOME/.npmrc" && \
rm -rf /var/cache/apt /var/lib/apt/ /tmp/*

ENV PATH="/opt/yarn/bin:$PATH"

ARG QD_BUILD="QDJVM-2023.2"
ARG QD_RELEASE="2023.2"
# hadolint ignore=DL3003,SC2043
Expand Down
4 changes: 2 additions & 2 deletions 2023.2/jvm-community/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ ENV HOME="/root" \
QODANA_DATA="/data" \
QODANA_DOCKER="true"
ENV JAVA_HOME="$QODANA_DIST/jbr" \
QODANA_CONF="$HOME/.config/idea"
ENV PATH="$QODANA_DIST/bin:$PATH"
QODANA_CONF="$HOME/.config/idea" \
PATH="$QODANA_DIST/bin:$PATH"

# hadolint ignore=SC2174
RUN mkdir -m 777 -p /opt $QODANA_DATA $QODANA_CONF && apt-get update && \
Expand Down
21 changes: 9 additions & 12 deletions 2023.2/jvm/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
ARG NODE_TAG="16-bullseye-slim"
ARG BASE_TAG="bullseye-slim"

FROM node:$NODE_TAG AS node_base
FROM debian:$BASE_TAG

ENV HOME="/root" \
Expand All @@ -10,9 +7,8 @@ ENV HOME="/root" \
QODANA_DATA="/data" \
QODANA_DOCKER="true"
ENV JAVA_HOME="$QODANA_DIST/jbr" \
QODANA_CONF="$HOME/.config/idea"

ENV PATH="$QODANA_DIST/bin:/opt/yarn/bin:$PATH"
QODANA_CONF="$HOME/.config/idea" \
PATH="$QODANA_DIST/bin:$PATH"

# hadolint ignore=SC2174
RUN mkdir -m 777 -p /opt $QODANA_DATA $QODANA_CONF && apt-get update && \
Expand All @@ -32,12 +28,11 @@ RUN mkdir -m 777 -p /opt $QODANA_DATA $QODANA_CONF && apt-get update && \
git config --global --add safe.directory '*' && \
rm -rf /var/cache/apt /var/lib/apt/ /tmp/*

ENV GRADLE_USER_HOME="/data/cache/gradle"

COPY --from=node_base /usr/local/bin/node /usr/local/bin/
COPY --from=node_base /usr/local/include/node /usr/local/include/node
COPY --from=node_base /usr/local/lib/node_modules /usr/local/lib/node_modules
COPY --from=node_base /opt/yarn-* /opt/yarn/
ENV PATH="/opt/yarn/bin:$PATH"
COPY --from=node:16-bullseye-slim /usr/local/bin/node /usr/local/bin/
COPY --from=node:16-bullseye-slim /usr/local/include/node /usr/local/include/node
COPY --from=node:16-bullseye-slim /usr/local/lib/node_modules /usr/local/lib/node_modules
COPY --from=node:16-bullseye-slim /opt/yarn-* /opt/yarn/
RUN ln -s /usr/local/lib/node_modules/npm/bin/npm-cli.js /usr/local/bin/npm && \
ln -s /usr/local/lib/node_modules/npm/bin/npx-cli.js /usr/local/bin/npx && \
ln -s /usr/local/lib/node_modules/corepack/dist/corepack.js /usr/local/bin/corepack && \
Expand All @@ -47,6 +42,8 @@ RUN ln -s /usr/local/lib/node_modules/npm/bin/npm-cli.js /usr/local/bin/npm && \
npm install -g [email protected] [email protected] && npm config set update-notifier false && \
chmod 777 -R "$HOME/.npm" "$HOME/.npmrc"

ENV GRADLE_USER_HOME="/data/cache/gradle"

ARG QD_BUILD="QDJVM-2023.2"
ARG QD_RELEASE="2023.2"
# hadolint ignore=DL3003,SC2043
Expand Down
16 changes: 9 additions & 7 deletions 2023.2/php/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ ENV HOME="/root" \
QODANA_DATA="/data" \
QODANA_DOCKER="true"
ENV JAVA_HOME="$QODANA_DIST/jbr" \
QODANA_CONF="$HOME/.config/idea"
ENV PATH="$QODANA_DIST/bin:/opt/yarn/bin:$PATH"
QODANA_CONF="$HOME/.config/idea" \
PATH="$QODANA_DIST/bin:$PATH"

# hadolint ignore=SC2174
RUN mkdir -m 777 -p /opt $QODANA_DATA $QODANA_CONF && apt-get update && \
Expand All @@ -32,11 +32,11 @@ RUN mkdir -m 777 -p /opt $QODANA_DATA $QODANA_CONF && apt-get update && \
git config --global --add safe.directory '*' && \
rm -rf /var/cache/apt /var/lib/apt/ /tmp/*

COPY --from=composer:2.5.1 /usr/bin/composer /usr/bin/composer
COPY --from=node_base /usr/local/bin/node /usr/local/bin/
COPY --from=node_base /usr/local/include/node /usr/local/include/node
COPY --from=node_base /usr/local/lib/node_modules /usr/local/lib/node_modules
COPY --from=node_base /opt/yarn-* /opt/yarn/
ENV PATH="/opt/yarn/bin:$PATH"
COPY --from=node:16-bullseye-slim /usr/local/bin/node /usr/local/bin/
COPY --from=node:16-bullseye-slim /usr/local/include/node /usr/local/include/node
COPY --from=node:16-bullseye-slim /usr/local/lib/node_modules /usr/local/lib/node_modules
COPY --from=node:16-bullseye-slim /opt/yarn-* /opt/yarn/
RUN ln -s /usr/local/lib/node_modules/npm/bin/npm-cli.js /usr/local/bin/npm && \
ln -s /usr/local/lib/node_modules/npm/bin/npx-cli.js /usr/local/bin/npx && \
ln -s /usr/local/lib/node_modules/corepack/dist/corepack.js /usr/local/bin/corepack && \
Expand All @@ -46,6 +46,8 @@ RUN ln -s /usr/local/lib/node_modules/npm/bin/npm-cli.js /usr/local/bin/npm && \
npm install -g [email protected] [email protected] && npm config set update-notifier false && \
chmod 777 -R "$HOME/.npm" "$HOME/.npmrc"

COPY --from=composer:2.5.1 /usr/bin/composer /usr/bin/composer

ARG QD_BUILD="QDPHP-2023.2"
ARG QD_RELEASE="2023.2"
# hadolint ignore=DL3003,SC2043
Expand Down
4 changes: 2 additions & 2 deletions 2023.2/python-community/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ ENV HOME="/root" \
QODANA_DATA="/data" \
QODANA_DOCKER="true"
ENV JAVA_HOME="$QODANA_DIST/jbr" \
QODANA_CONF="$HOME/.config/idea"
ENV PATH="$QODANA_DIST/bin:$PATH"
QODANA_CONF="$HOME/.config/idea" \
PATH="$QODANA_DIST/bin:$PATH"

# hadolint ignore=SC2174
RUN mkdir -m 777 -p /opt $QODANA_DATA $QODANA_CONF && apt-get update && \
Expand Down
16 changes: 7 additions & 9 deletions 2023.2/python/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
ARG NODE_TAG="16-bullseye-slim"
ARG BASE_TAG="bullseye-slim"

FROM node:$NODE_TAG AS node_base
FROM debian:$BASE_TAG

ENV HOME="/root" \
Expand All @@ -10,8 +7,8 @@ ENV HOME="/root" \
QODANA_DATA="/data" \
QODANA_DOCKER="true"
ENV JAVA_HOME="$QODANA_DIST/jbr" \
QODANA_CONF="$HOME/.config/idea"
ENV PATH="$QODANA_DIST/bin:/opt/yarn/bin:$PATH"
QODANA_CONF="$HOME/.config/idea" \
PATH="$QODANA_DIST/bin:$PATH"

# hadolint ignore=SC2174
RUN mkdir -m 777 -p /opt $QODANA_DATA $QODANA_CONF && apt-get update && \
Expand Down Expand Up @@ -69,10 +66,11 @@ RUN apt-get update && \
${CONDA_DIR}/bin/conda install -c conda-forge poetry pipenv && ${CONDA_DIR}/bin/conda clean -afy && \
rm -rf /var/cache/apt /var/lib/apt/ /tmp/*

COPY --from=node_base /usr/local/bin/node /usr/local/bin/
COPY --from=node_base /usr/local/include/node /usr/local/include/node
COPY --from=node_base /usr/local/lib/node_modules /usr/local/lib/node_modules
COPY --from=node_base /opt/yarn-* /opt/yarn/
ENV PATH="/opt/yarn/bin:$PATH"
COPY --from=node:16-bullseye-slim /usr/local/bin/node /usr/local/bin/
COPY --from=node:16-bullseye-slim /usr/local/include/node /usr/local/include/node
COPY --from=node:16-bullseye-slim /usr/local/lib/node_modules /usr/local/lib/node_modules
COPY --from=node:16-bullseye-slim /opt/yarn-* /opt/yarn/
RUN ln -s /usr/local/lib/node_modules/npm/bin/npm-cli.js /usr/local/bin/npm && \
ln -s /usr/local/lib/node_modules/npm/bin/npx-cli.js /usr/local/bin/npx && \
ln -s /usr/local/lib/node_modules/corepack/dist/corepack.js /usr/local/bin/corepack && \
Expand Down

0 comments on commit ed52b27

Please sign in to comment.