Skip to content

Commit

Permalink
Convert meshcmd image to bake
Browse files Browse the repository at this point in the history
  • Loading branch information
taylorific committed Nov 19, 2023
1 parent 78e14e4 commit 29b0b19
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 14 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ jobs:
base: ${{ github.ref }}
filters: |
aws-cli: 'aws-cli/**'
meshcmd: 'meshcmd/**'
# Job to build and test each of the modified images
build:
Expand Down Expand Up @@ -109,4 +110,4 @@ jobs:
repository: boxcutter/${{ env.image_name }}
short-description: ${{ env.image_description }}
readme-filepath: ${{ matrix.image }}/README.md


2 changes: 0 additions & 2 deletions meshcmd/.dockerignore
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
README.md
Polly.toml
test/
7 changes: 1 addition & 6 deletions meshcmd/Containerfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,7 @@ RUN <<EOF
curl -o /tmp/meshcmd/meshcmd "$MESHCMD_URL"
EOF

FROM $CONTAINER_REGISTRY/ubuntu:jammy-20231004

LABEL \
org.opencontainers.image.source="https://github.com/boxcutter/oci" \
org.opencontainers.image.licenses="Apache-2.0" \
org.opencontainers.image.description="Command line tool used to perform many tasks related to computer management of Intel Active Management Technology (AMT) devices."
FROM build


WORKDIR /opt/meshcmd/bin
Expand Down
2 changes: 0 additions & 2 deletions meshcmd/Polly.toml

This file was deleted.

42 changes: 39 additions & 3 deletions meshcmd/docker-bake.hcl
Original file line number Diff line number Diff line change
@@ -1,5 +1,41 @@
target "default" {
variable "IMAGE_NAME" {
default = "meshcmd"
}

variable "VERSION" {
default = "1.1.9"
}

variable "CONTAINER_REGISTRY" {
default = "docker.io/boxcutter"
}

# There's no darwin-based Docker, so if we're running on macOS, change the platform to linux
variable "LOCAL_PLATFORM" {
default = regex_replace("${BAKE_LOCAL_PLATFORM}", "^(darwin)", "linux")
}

target "_common" {
dockerfile = "Containerfile"
tags = ["docker.io/boxcutter/meshcmd:1.1.9",
"docker.io/boxcutter/meshcmd:latest"]
tags = [
"${CONTAINER_REGISTRY}/${IMAGE_NAME}:${VERSION}",
"${CONTAINER_REGISTRY}/${IMAGE_NAME}:latest"
]
}

target "local" {
inherits = ["_common"]
platforms = ["${LOCAL_PLATFORM}"]
}

target "default" {
inherits = ["_common"]
target = "release"
platforms = ["linux/amd64", "linux/arm64/v8"]
labels = {
"org.opencontainers.image.source" = "https://github.com/polymathrobotics/oci"
"org.opencontainers.image.licenses" = "Apache-2.0"
"org.opencontainers.image.description" = "Command line tool used to perform many tasks related to computer management of Intel Active Management Technology (AMT) devices."
"org.opencontainers.image.title" = "${IMAGE_NAME}"
}
}

0 comments on commit 29b0b19

Please sign in to comment.