Skip to content

Commit

Permalink
update docker build
Browse files Browse the repository at this point in the history
  • Loading branch information
mpromonet committed May 3, 2024
1 parent 890cdbe commit ef86de3
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 64 deletions.
8 changes: 5 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,8 @@ jobs:
command: |
export TAG=${CIRCLE_TAG:-latest}
docker login --username=$DOCKERHUB_USER --password=$DOCKERHUB_PASS
docker build --pull -t $CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME:${TAG}-arm32v7 -f Dockerfile.rpi .
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
docker build --pull -t $CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME:${TAG}-arm32v7 --build-arg IMAGE=balenalib/raspberry-pi2 .
docker push $CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME:${TAG}-arm32v7
# -------------------------------------
Expand All @@ -161,7 +162,8 @@ jobs:
command: |
export TAG=${CIRCLE_TAG:-latest}
docker login --username=$DOCKERHUB_USER --password=$DOCKERHUB_PASS
docker build --build-arg ARCH=armv6l --pull -t $CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME:${TAG}-arm32v6 -f Dockerfile.rpi .
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
docker build --build-arg ARCH=armv6l --pull -t $CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME:${TAG}-arm32v6 --build-arg IMAGE=balenalib/raspberry-pi .
docker push $CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME:${TAG}-arm32v6
# -------------------------------------
Expand All @@ -179,7 +181,7 @@ jobs:
export TAG=${CIRCLE_TAG:-latest}
docker login --username=$DOCKERHUB_USER --password=$DOCKERHUB_PASS
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
docker build --pull -t $CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME:${TAG}-arm64 -f Dockerfile.arm64 .
docker build --pull -t $CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME:${TAG}-arm64 --build-arg IMAGE=arm64v8/ubuntu:24.04 .
docker push $CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME:${TAG}-arm64
# -------------------------------------
Expand Down
12 changes: 8 additions & 4 deletions .cirrus.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
linux_docker_builder:
script: docker build -t $CIRRUS_REPO_FULL_NAME:cirrus-linux . -f Dockerfile
script: docker build -t $CIRRUS_REPO_FULL_NAME:cirrus-linux .

linuxarmv7_docker_builder:
script: docker build -t $CIRRUS_REPO_FULL_NAME:cirrus-rpi . -f Dockerfile.rpi
script: |
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
docker build -t $CIRRUS_REPO_FULL_NAME:cirrus-armv7 . --build-arg IMAGE=balenalib/raspberry-pi2
linuxarmv6_docker_builder:
script: docker build -t $CIRRUS_REPO_FULL_NAME:cirrus-armv6 . -f Dockerfile.rpi --build-arg ARCH=armv6l
script: |
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
docker build -t $CIRRUS_REPO_FULL_NAME:cirrus-armv6 . --build-arg IMAGE=balenalib/raspberry-pi
linuxarm64_docker_builder:
script: |
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
docker build -t $CIRRUS_REPO_FULL_NAME:cirrus-arm64 . -f Dockerfile.arm64
docker build -t $CIRRUS_REPO_FULL_NAME:cirrus-arm64 . --build-arg IMAGE=arm64v8/ubuntu:24.04
11 changes: 7 additions & 4 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,16 @@ jobs:
matrix:
include:
- os: ubuntu-latest
dockerfile: Dockerfile.arm64
image: arm64v8/ubuntu:24.04
label: arm64
- os: ubuntu-latest
dockerfile: Dockerfile.rpi
image: balenalib/raspberry-pi
label: armv6l
- os: ubuntu-latest
dockerfile: Dockerfile
image: balenalib/raspberry-pi2
label: armv7
- os: ubuntu-latest
image: ubuntu:24.04
label: amd64

runs-on: ${{ matrix.os }}
Expand All @@ -25,4 +28,4 @@ jobs:
- name: Build an image from Dockerfile
run: |
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
docker build -t docker.io/${{ github.repository }}:${{ matrix.label }} -f ${{ matrix.dockerfile }} .
docker build -t docker.io/${{ github.repository }}:${{ matrix.label }} --build-arg IMAGE=${{ matrix.image }} .
5 changes: 3 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
FROM ubuntu:24.04 as builder
ARG IMAGE=ubuntu:24.04
FROM $IMAGE as builder
LABEL maintainer [email protected]
WORKDIR /v4l2rtspserver

Expand All @@ -8,7 +9,7 @@ COPY . .

RUN cmake . && make install && apt-get clean && rm -rf /var/lib/apt/lists/

FROM ubuntu:24.04
FROM $IMAGE
WORKDIR /usr/local/share/v4l2rtspserver

RUN apt-get update \
Expand Down
27 changes: 0 additions & 27 deletions Dockerfile.arm64

This file was deleted.

24 changes: 0 additions & 24 deletions Dockerfile.rpi

This file was deleted.

0 comments on commit ef86de3

Please sign in to comment.