Add revision to build args

This commit is contained in:
Kristian Haugene
2020-11-04 01:09:46 +01:00
parent cd9a5694cf
commit 599283632d

View File

@@ -55,7 +55,10 @@ jobs:
distro: alpine distro: alpine
- run: - run:
name: Build Docker image name: Build Docker image
command: docker build -t $IMAGE_NAME:$IMAGE_TAG . command: |
docker build \
-t $IMAGE_NAME:$IMAGE_TAG \
--build-arg REVISION=$CIRCLE_SHA1 .
- run: - run:
name: Login to Docker Hub name: Login to Docker Hub
command: echo $DOCKER_PASS | docker login -u $DOCKER_USER --password-stdin command: echo $DOCKER_PASS | docker login -u $DOCKER_USER --password-stdin
@@ -78,7 +81,10 @@ jobs:
command: | command: |
echo "Un-commenting cross-build instructions in Dockerfile.armhf" echo "Un-commenting cross-build instructions in Dockerfile.armhf"
sed -i 's/^#\(.*cross-build.*\)/\1/' Dockerfile.armhf sed -i 's/^#\(.*cross-build.*\)/\1/' Dockerfile.armhf
docker build -t $IMAGE_NAME:$IMAGE_TAG -f Dockerfile.armhf . docker build \
-t $IMAGE_NAME:$IMAGE_TAG \
-f Dockerfile.armhf \
--build-arg REVISION=$CIRCLE_SHA1 .
- run: - run:
name: Login to Docker Hub name: Login to Docker Hub
command: echo $DOCKER_PASS | docker login -u $DOCKER_USER --password-stdin command: echo $DOCKER_PASS | docker login -u $DOCKER_USER --password-stdin
@@ -104,7 +110,8 @@ jobs:
docker build \ docker build \
-t $IMAGE_NAME:$IMAGE_TAG \ -t $IMAGE_NAME:$IMAGE_TAG \
-f Dockerfile.armhf \ -f Dockerfile.armhf \
--build-arg base_image=balenalib/raspberrypi3-64:buster . --build-arg base_image=balenalib/raspberrypi3-64:buster \
--build-arg REVISION=$CIRCLE_SHA1 .
- run: - run:
name: Login to Docker Hub name: Login to Docker Hub
command: echo $DOCKER_PASS | docker login -u $DOCKER_USER --password-stdin command: echo $DOCKER_PASS | docker login -u $DOCKER_USER --password-stdin