Better build command

This commit is contained in:
Florian Hoss 2024-05-31 11:48:35 +02:00
parent 90323b378b
commit b5d0862303
No known key found for this signature in database
GPG key ID: 0638DC11BFD36662
2 changed files with 10 additions and 17 deletions

View file

@ -28,8 +28,16 @@ build:
- !reference [.auth_gitlab, before_script]
script:
- docker buildx create --use
- docker compose build godash
- docker tag $CURRENT_IMAGE $LATEST_IMAGE
- docker buildx build \
--provenance=false \
--platform=linux/amd64,linux/arm64 \
--build-arg APP_VERSION=${CI_COMMIT_TAG} \
--build-arg V_GOLANG=${V_GOLANG} \
--build-arg V_NODE=${V_NODE} \
--build-arg V_ALPINE=${V_ALPINE} \
--tag ${CURRENT_IMAGE} \
--tag ${LATEST_IMAGE} \
--pull --push
- docker push $CURRENT_IMAGE
- docker push $LATEST_IMAGE
after_script:

View file

@ -84,21 +84,6 @@ services:
volumes:
- .:/app/
godash:
profiles: [build]
image: ${CURRENT_IMAGE}
build:
context: .
dockerfile: Dockerfile
platforms:
- linux/amd64
- linux/arm64
args:
- V_GOLANG=${V_GOLANG}
- V_NODE=${V_NODE}
- V_ALPINE=${V_ALPINE}
- APP_VERSION=${CI_COMMIT_TAG}
golang:
profiles: [install]
image: golang:${V_GOLANG}-alpine