Skip to content

Commit

Permalink
Merge pull request #48 from thin-edge/fix-publish-multi-arch
Browse files Browse the repository at this point in the history
fix: publish multi arch image (again)
  • Loading branch information
reubenmiller authored Nov 26, 2024
2 parents efb92f9 + cd02d19 commit af09a70
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 7 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ jobs:

- name: Setup Docker buildx
uses: docker/setup-buildx-action@v3
with:
install: true

- name: Login to GitHub Container Registry
uses: docker/login-action@v3
Expand All @@ -34,4 +36,4 @@ jobs:
- uses: taiki-e/install-action@just

- name: Publish images
run: just build registry ${{ inputs.VERSION || github.ref_name }}
run: just publish registry ${{ inputs.VERSION || github.ref_name }}
34 changes: 28 additions & 6 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,37 @@ build-setup:
docker buildx install
docker run --privileged --rm tonistiigi/binfmt --install all


# Build the docker images
# Build docker images (for testing)
build OUTPUT_TYPE=DEFAULT_OUTPUT_TYPE VERSION='latest': build-setup
docker buildx build \
--label "org.opencontainers.image.version={{VERSION}}" \
--build-arg "TEDGE_IMAGE={{TEDGE_IMAGE}}" \
--build-arg "TEDGE_TAG={{TEDGE_TAG}}" \
-t "{{REGISTRY}}/{{REPO_OWNER}}/{{IMAGE}}:{{VERSION}}" \
-t "{{REGISTRY}}/{{REPO_OWNER}}/{{IMAGE}}:latest" \
-f Dockerfile \
--output=type="{{OUTPUT_TYPE}}",oci-mediatypes=false \
--provenance=false \
.

# Publish docker images (multi-arch)
# Example:
# just build registry latest
# just build registry 1.2.0
# just publish registry latest
# just publish registry 1.2.0
# Use oci-mediatypes=false to improve compatibility with older docker versions, e.g. <= 19.0.x
# See https://github.com/docker/buildx/issues/1964#issuecomment-1644634461
build OUTPUT_TYPE=DEFAULT_OUTPUT_TYPE VERSION='latest': build-setup
docker buildx build --build-arg "TEDGE_IMAGE={{TEDGE_IMAGE}}" --build-arg "TEDGE_TAG={{TEDGE_TAG}}" -t "{{REGISTRY}}/{{REPO_OWNER}}/{{IMAGE}}:{{VERSION}}" -t "{{REGISTRY}}/{{REPO_OWNER}}/{{IMAGE}}:latest" -f Dockerfile --output=type="{{OUTPUT_TYPE}}",oci-mediatypes=false --provenance=false .
publish OUTPUT_TYPE=DEFAULT_OUTPUT_TYPE VERSION='latest': build-setup
docker buildx build \
--platform linux/arm/v6,linux/arm/v7,linux/amd64,linux/arm64 \
--label "org.opencontainers.image.version={{VERSION}}" \
--build-arg "TEDGE_IMAGE={{TEDGE_IMAGE}}" \
--build-arg "TEDGE_TAG={{TEDGE_TAG}}" \
-t "{{REGISTRY}}/{{REPO_OWNER}}/{{IMAGE}}:{{VERSION}}" \
-t "{{REGISTRY}}/{{REPO_OWNER}}/{{IMAGE}}:latest" \
-f Dockerfile \
--output=type="{{OUTPUT_TYPE}}",oci-mediatypes=false \
--provenance=false \
.

# Install python virtual environment
venv:
Expand Down

6 comments on commit af09a70

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Robot Results

✅ Passed ❌ Failed ⏭️ Skipped Total Pass % ⏱️ Duration
14 0 1 14 100 2m14.729038s

Passed Tests

Name ⏱️ Duration Suite
Grace period to allow container to startup 5.050 s Operations
Service is up 0.144 s Operations
Get Logfile Request 2.342 s Operations
Get Configuration File 4.677 s Operations
Execute Shell Command 2.382 s Operations
Install application using docker compose 17.429 s Operations
Get Container Logs 2.360 s Operations
Trigger self update via local command 19.575 s Self-Update
Self update should only update if there is a new image 16.626 s Self-Update
Self update using software update operation 42.829 s Self-Update
Rollback when trying to install a non-tedge based image 18.409 s Self-Update
Cloud Connection is Online 0.156 s Telemetry
Service status 0.252 s Telemetry
Sends measurements 2.461 s Telemetry

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Robot Results

✅ Passed ❌ Failed ⏭️ Skipped Total Pass % ⏱️ Duration
14 0 1 14 100 2m17.176549s

Passed Tests

Name ⏱️ Duration Suite
Grace period to allow container to startup 5.046 s Operations
Service is up 0.163 s Operations
Get Logfile Request 2.391 s Operations
Get Configuration File 4.846 s Operations
Execute Shell Command 2.406 s Operations
Install application using docker compose 19.763 s Operations
Get Container Logs 2.412 s Operations
Trigger self update via local command 19.728 s Self-Update
Self update should only update if there is a new image 15.809 s Self-Update
Self update using software update operation 43.019 s Self-Update
Rollback when trying to install a non-tedge based image 18.530 s Self-Update
Cloud Connection is Online 0.179 s Telemetry
Service status 0.299 s Telemetry
Sends measurements 2.544 s Telemetry

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Robot Results

✅ Passed ❌ Failed ⏭️ Skipped Total Pass % ⏱️ Duration
14 0 1 14 100 2m17.734399s

Passed Tests

Name ⏱️ Duration Suite
Grace period to allow container to startup 5.047 s Operations
Service is up 0.178 s Operations
Get Logfile Request 2.440 s Operations
Get Configuration File 4.838 s Operations
Execute Shell Command 2.445 s Operations
Install application using docker compose 17.793 s Operations
Get Container Logs 2.442 s Operations
Trigger self update via local command 19.992 s Self-Update
Self update should only update if there is a new image 15.703 s Self-Update
Self update using software update operation 43.455 s Self-Update
Rollback when trying to install a non-tedge based image 20.315 s Self-Update
Cloud Connection is Online 0.178 s Telemetry
Service status 0.294 s Telemetry
Sends measurements 2.579 s Telemetry

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Robot Results

✅ Passed ❌ Failed ⏭️ Skipped Total Pass % ⏱️ Duration
14 0 1 14 100 2m29.032528999s

Passed Tests

Name ⏱️ Duration Suite
Grace period to allow container to startup 5.036 s Operations
Service is up 0.219 s Operations
Get Logfile Request 2.578 s Operations
Get Configuration File 5.131 s Operations
Execute Shell Command 2.586 s Operations
Install application using docker compose 20.590 s Operations
Get Container Logs 2.589 s Operations
Trigger self update via local command 20.792 s Self-Update
Self update should only update if there is a new image 18.095 s Self-Update
Self update using software update operation 44.891 s Self-Update
Rollback when trying to install a non-tedge based image 23.108 s Self-Update
Cloud Connection is Online 0.225 s Telemetry
Service status 0.394 s Telemetry
Sends measurements 2.759 s Telemetry

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Robot Results

✅ Passed ❌ Failed ⏭️ Skipped Total Pass % ⏱️ Duration
14 0 1 14 100 2m31.383280999s

Passed Tests

Name ⏱️ Duration Suite
Grace period to allow container to startup 5.056 s Operations
Service is up 0.154 s Operations
Get Logfile Request 2.361 s Operations
Get Configuration File 4.721 s Operations
Execute Shell Command 2.370 s Operations
Install application using docker compose 17.509 s Operations
Get Container Logs 2.383 s Operations
Trigger self update via local command 23.520 s Self-Update
Self update should only update if there is a new image 20.189 s Self-Update
Self update using software update operation 47.805 s Self-Update
Rollback when trying to install a non-tedge based image 22.371 s Self-Update
Cloud Connection is Online 0.164 s Telemetry
Service status 0.259 s Telemetry
Sends measurements 2.476 s Telemetry

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Robot Results

✅ Passed ❌ Failed ⏭️ Skipped Total Pass % ⏱️ Duration
14 0 1 14 100 2m39.227048999s

Passed Tests

Name ⏱️ Duration Suite
Grace period to allow container to startup 5.064 s Operations
Service is up 0.225 s Operations
Get Logfile Request 2.568 s Operations
Get Configuration File 5.119 s Operations
Execute Shell Command 2.584 s Operations
Install application using docker compose 20.913 s Operations
Get Container Logs 4.766 s Operations
Trigger self update via local command 23.025 s Self-Update
Self update should only update if there is a new image 20.360 s Self-Update
Self update using software update operation 45.531 s Self-Update
Rollback when trying to install a non-tedge based image 23.469 s Self-Update
Cloud Connection is Online 0.230 s Telemetry
Service status 2.570 s Telemetry
Sends measurements 2.754 s Telemetry

Please sign in to comment.