Skip to content

Commit

Permalink
add build image arg as well
Browse files Browse the repository at this point in the history
Signed-off-by: Enrique Lacal <enrique.lacal@kaleido.io>
  • Loading branch information
EnriqueL8 committed May 23, 2024
1 parent 6570d0d commit 57bcd7b
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 3 deletions.
1 change: 1 addition & 0 deletions .github/workflows/docker_main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ jobs:
--label commit=$GITHUB_SHA \
--label build_date=$(date -u +"%Y-%m-%dT%H:%M:%SZ") \
--label tag=${{ steps.build_tag_generator.outputs.BUILD_TAG }} \
--build-arg BUILD_IMAGE=node:20-alpine3.17 \
--build-arg BASE_IMAGE=node:20-alpine3.17 \
--tag ghcr.io/hyperledger/firefly-tokens-erc20-erc721:${{ steps.build_tag_generator.outputs.BUILD_TAG }} .
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/docker_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ jobs:
--tag ghcr.io/hyperledger/firefly-tokens-erc20-erc721:${GITHUB_REF##*/} \
--tag ghcr.io/hyperledger/firefly-tokens-erc20-erc721:head \
--build-arg BASE_IMAGE=node:20-alpine3.17 \
--build-arg BUILD_IMAGE=node:20-alpine3.17 \
.
- name: Tag release
Expand Down
5 changes: 3 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
ARG BASE_IMAGE
ARG BUILD_IMAGE

FROM node:20-alpine3.17 as build
FROM ${BUILD_IMAGE} as build
USER node
WORKDIR /home/node
ADD --chown=node:node package*.json ./
RUN npm install
ADD --chown=node:node . .
RUN npm run build

FROM node:20-alpine3.17 as solidity-build
FROM ${BUILD_IMAGE} as solidity-build
RUN apk add python3=3.10.14-r1 alpine-sdk=1.0-r1
USER node
WORKDIR /home/node
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"scripts": {
"prebuild": "rimraf dist",
"build": "nest build",
"docker": "docker build --build-arg BASE_IMAGE=node:20-alpine3.17 --tag hyperledger/firefly-tokens-erc20-erc721 .",
"docker": "docker build --build-arg BASE_IMAGE=node:20-alpine3.17 --build-arg BUILD_IMAGE=node:20-alpine3.17 --tag hyperledger/firefly-tokens-erc20-erc721 .",
"format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\"",
"start": "nest start",
"start:dev": "nest start --watch",
Expand Down

0 comments on commit 57bcd7b

Please sign in to comment.