From 82a00d4cca276a2493f6bcbd5c126bd67c5c95f8 Mon Sep 17 00:00:00 2001 From: James Talton Date: Fri, 20 Jan 2023 11:30:25 -0500 Subject: [PATCH] test docker cache Signed-off-by: James Talton --- .github/workflows/main.yml | 5 +++-- Dockerfile | 10 +++++++--- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 8f50050d2a..b26448eaec 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -95,9 +95,10 @@ jobs: uses: docker/build-push-action@v3 with: # platforms: linux/amd64,linux/arm64 - Quay does not seem to support this :( + context: . + push: true tags: quay.io/ansible/ansible-ui:latest,quay.io/ansible/ansible-ui:${{ needs.tag.outputs.VERSION }} - labels: version=${{ needs.tag.outputs.VERSION }} + # labels: version=${{ needs.tag.outputs.VERSION }} build-args: VERSION=${{ needs.tag.outputs.VERSION }} - push: true cache-from: type=gha cache-to: type=gha,mode=max diff --git a/Dockerfile b/Dockerfile index 754a99c401..d5951781c1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,13 +3,17 @@ WORKDIR /app COPY package*.json ./ RUN npm version 0.0.0 --no-git-tag-version -FROM --platform=${TARGETPLATFORM:-linux/amd64} node:18-alpine as builder -ARG VERSION -RUN apk upgrade --no-cache -U && apk add --no-cache openssl +FROM --platform=${TARGETPLATFORM:-linux/amd64} node:18-alpine as dependencies WORKDIR /app COPY --from=package /app/package*.json ./ RUN npm ci --omit=optional --ignore-scripts + +FROM --platform=${TARGETPLATFORM:-linux/amd64} node:18-alpine as builder +RUN apk upgrade --no-cache -U && apk add --no-cache openssl +WORKDIR /app +COPY --from=dependencies /app/. . COPY . . +ARG VERSION RUN VERSION=$VERSION DISCLAIMER=true npm run build FROM --platform=${TARGETPLATFORM:-linux/amd64} alpine