Skip to content

Commit 9dcec65

Browse files
authored
Fix build docker cache (#2046)
1 parent 570b3ed commit 9dcec65

File tree

4 files changed

+12
-18
lines changed

4 files changed

+12
-18
lines changed

.github/workflows/build_application_docker.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -50,21 +50,21 @@ jobs:
5050
echo "BUILD_VERSION=$BUILD_VERSION" >> "$GITHUB_ENV"
5151
echo "COMMIT_NAME=$COMMIT_NAME" >> "$GITHUB_ENV"
5252
- name: Log in to the Container registry
53-
uses: docker/login-action@v3.0.0
53+
uses: docker/login-action@v3
5454
with:
5555
registry: ${{ env.REGISTRY }}
5656
username: ${{ github.actor }}
5757
password: ${{ secrets.GITHUB_TOKEN }}
5858
- name: Extract tags for Docker
5959
id: meta
60-
uses: docker/metadata-action@v5.0.0
60+
uses: docker/metadata-action@v5
6161
with:
6262
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
6363
tags: |
6464
type=raw,value=${{ env.BUILD_VERSION }}
6565
${{ contains(env.COMMIT_NAME, '[release]') && 'type=raw,value=latest' || '' }}
6666
- name: Build and push Docker image
67-
uses: docker/build-push-action@v5.0.0
67+
uses: docker/build-push-action@v6
6868
with:
6969
build-args: |
7070
app_version=${{ env.BUILD_VERSION }}

.github/workflows/e2e_build_application_docker.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -50,20 +50,20 @@ jobs:
5050
echo "BUILD_VERSION=$BUILD_VERSION" >> "$GITHUB_ENV"
5151
echo "COMMIT_NAME=$COMMIT_NAME" >> "$GITHUB_ENV"
5252
- name: Log in to the Container registry
53-
uses: docker/login-action@v3.0.0
53+
uses: docker/login-action@v3
5454
with:
5555
registry: ${{ env.REGISTRY }}
5656
username: ${{ github.actor }}
5757
password: ${{ secrets.GITHUB_TOKEN }}
5858
- name: Extract tags for Docker
5959
id: meta
60-
uses: docker/metadata-action@v5.0.0
60+
uses: docker/metadata-action@v5
6161
with:
6262
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
6363
tags: |
6464
type=raw,value=${{ env.BUILD_VERSION }}-e2e
6565
- name: Build and push Docker image
66-
uses: docker/build-push-action@v5.0.0
66+
uses: docker/build-push-action@v6
6767
with:
6868
build-args: |
6969
app_version=${{ env.BUILD_VERSION }}

Dockerfile

+3-6
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,9 @@ ARG NODE_MAJOR=20
66
ENV DEBIAN_FRONTEND=noninteractive
77
ENV NODE_EXTRA_CA_CERTS=/usr/local/share/ca-certificates/cert.pem
88

9-
RUN apt-get update && apt-get -y upgrade
9+
RUN apt-get update && apt-get -y upgrade && apt-get -y install ca-certificates curl gnupg
1010

1111
# node
12-
RUN apt-get -y install ca-certificates curl gnupg
1312
RUN mkdir -p /etc/apt/keyrings
1413
RUN curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg
1514

@@ -37,17 +36,15 @@ ARG NODE_MAJOR=20
3736

3837
ENV DEBIAN_FRONTEND=noninteractive
3938

40-
RUN apt-get update && apt-get -y upgrade
39+
RUN apt-get update && apt-get -y upgrade && apt-get -y install ca-certificates curl gnupg
4140

4241
# node
43-
RUN apt-get -y install ca-certificates curl gnupg
4442
RUN mkdir -p /etc/apt/keyrings
4543
RUN curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg
4644

4745
RUN echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_${NODE_MAJOR}.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list
4846

49-
RUN apt-get update
50-
RUN apt-get -y install nginx supervisor nodejs
47+
RUN apt-get update && apt-get -y install nginx supervisor nodejs
5148

5249
# remove unnecessary packages
5350
RUN apt-get -y purge curl gnupg gnupg2 && \

tests/Dockerfile

+3-6
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,15 @@ ARG NODE_MAJOR=20
44

55
ENV DEBIAN_FRONTEND=noninteractive
66

7-
RUN apt-get update && apt-get -y upgrade
7+
RUN apt-get update && apt-get -y upgrade && apt-get -y install ca-certificates curl gnupg
88

99
# node
10-
RUN apt-get -y install ca-certificates curl gnupg
1110
RUN mkdir -p /etc/apt/keyrings
1211
RUN curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg
1312

1413
RUN echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_${NODE_MAJOR}.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list
1514

16-
RUN apt-get update
17-
RUN apt-get -y install nodejs
15+
RUN apt-get update && apt-get -y install nodejs
1816

1917
# remove unnecessary packages
2018
RUN apt-get -y purge curl gnupg gnupg2 && \
@@ -55,8 +53,7 @@ COPY package.json package-lock.json /opt/app/
5553
COPY --from=install-stage /opt/app/node_modules /opt/app/node_modules
5654

5755
# split install playwright deps and browser
58-
RUN npx playwright install chromium ffmpeg --with-deps --dry-run | grep --color=never 'sh -c' | sed 's|sh -c "||' | sed 's|"||' > ./deps.sh
59-
RUN chmod +x ./deps.sh && ./deps.sh && rm -rf ./deps.sh
56+
RUN npx playwright install chromium ffmpeg --with-deps --dry-run | grep --color=never 'sh -c' | sed 's|sh -c "||' | sed 's|"||' > ./deps.sh && chmod +x ./deps.sh && ./deps.sh && rm -rf ./deps.sh
6057

6158
ENV PLAYWRIGHT_DOWNLOAD_HOST=https://storage.yandexcloud.net/playwright
6259
ENV PLAYWRIGHT_BROWSERS_PATH=/opt/app/pw-browsers

0 commit comments

Comments
 (0)