Skip to content

Commit

Permalink
test docker cache
Browse files Browse the repository at this point in the history
Signed-off-by: James Talton <[email protected]>
  • Loading branch information
jamestalton committed Jan 20, 2023
1 parent e7c1899 commit 82a00d4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
10 changes: 7 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 82a00d4

Please sign in to comment.