diff --git a/.dockerignore b/.dockerignore index 47a34c9..a2aede5 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,6 +1,9 @@ +.DS_Store /.fleet +/.github /.idea /.run /elf /target /tmp +Dockerfile diff --git a/.github/workflows/build-image.yml b/.github/workflows/build-image.yml index 7947491..e200b3e 100644 --- a/.github/workflows/build-image.yml +++ b/.github/workflows/build-image.yml @@ -2,7 +2,7 @@ name: Create and publish a Docker image on: push: - branches: ['release'] + branches: ['release', 'test'] tags: ['v*'] # Defines two custom environment variables for the workflow. These are used for the Container registry domain, and a name for the Docker image that this workflow builds. @@ -20,10 +20,6 @@ jobs: packages: write # steps: - - name: Checkout repository - uses: actions/checkout@v4 - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 # Uses the `docker/login-action` action to log in to the Container registry using the account and password that will publish the packages. Once published, the packages are scoped to the account defined here. @@ -46,10 +42,9 @@ jobs: # It uses the `context` parameter to define the build's context as the set of files located in the specified path. For more information, see "[Usage](https://github.com/docker/build-push-action#usage)" in the README of the `docker/build-push-action` repository. # It uses the `tags` and `labels` parameters to tag and label the image with the output from the "meta" step. - name: Build and push Docker image - uses: docker/build-push-action@v5 + uses: docker/build-push-action@v6 with: - context: . - platforms: linux/amd64,linux/arm64 + platforms: linux/amd64 push: true tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} diff --git a/.gitignore b/.gitignore index f6a8636..1f876ca 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ -/target +.DS_Store /.idea -/elf/ -/tmp/ - +/.run +/elf +/target +/tmp diff --git a/Dockerfile b/Dockerfile index 2142451..13b8185 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,12 +1,10 @@ FROM rust:alpine AS base -RUN apk add --no-cache musl-dev openssl-dev pkgconfig openssl-libs-static +RUN apk add --no-cache musl-dev openssl-dev openssl-libs-static pkgconfig +WORKDIR /app FROM base AS builder -WORKDIR /app COPY . . -RUN --mount=type=cache,target=/app/target \ - --mount=type=cache,from=base,source=/usr/local/rustup,target=/usr/local/rustup \ - cargo install --locked --path . +RUN cargo install --locked --path . --bin charms FROM alpine AS runtime COPY --from=builder /usr/local/cargo/bin/charms /usr/local/bin