diff --git a/.github/workflows/docker.yaml b/.github/workflows/docker.yaml index abde32b..6fd5406 100644 --- a/.github/workflows/docker.yaml +++ b/.github/workflows/docker.yaml @@ -1,3 +1,12 @@ +# This workflow uses actions that are not certified by GitHub. +# They are provided by a third-party and are governed by +# separate terms of service, privacy policy, and support +# documentation. + +# GitHub recommends pinning actions to a commit SHA. +# To get a newer version, you will need to update the SHA. +# You can also reference a tag or branch, but the action may change without warning. + name: Publish Docker image on: @@ -10,24 +19,25 @@ jobs: runs-on: ubuntu-latest steps: - name: Check out the repo - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Log in to Docker Hub - uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9 + uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a with: username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_PASSWORD }} - name: Extract metadata (tags, labels) for Docker id: meta - uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38 + uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7 with: - images: sinkingpoint/prometheus-gravel-gateway + images: my-docker-hub-namespace/my-docker-hub-repository - name: Build and push Docker image - uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc + uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671 with: context: . + file: ./Dockerfile push: true tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} \ No newline at end of file + labels: ${{ steps.meta.outputs.labels }} diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 023deeb..90995f6 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -17,7 +17,7 @@ jobs: - target: x86_64-apple-darwin archive: zip steps: - - uses: actions/checkout@master + - uses: actions/checkout@v4 - name: Compile and release uses: rust-build/rust-build.action@latest env: diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 3c13d1b..783076c 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -15,7 +15,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Build run: cargo build --verbose - name: Run tests diff --git a/Dockerfile b/Dockerfile index 5b550e7..ca6ae9a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,11 +1,12 @@ -FROM ekidd/rust-musl-builder:stable as builder +FROM clux/muslrust:stable as builder + ADD --chown=rust:rust . ./ RUN cargo build --release -FROM alpine:latest as runner +FROM alpine:latest ARG APP_USER=gravel RUN addgroup -S $APP_USER && adduser -S -g $APP_USER $APP_USER -COPY --from=builder /home/rust/src/target/x86_64-unknown-linux-musl/release/gravel-gateway /usr/bin/gravel-gateway +COPY --from=builder ./volume/target/x86_64-unknown-linux-musl/release/gravel-gateway /usr/bin/gravel-gateway RUN chown -R $APP_USER:$APP_USER /usr/bin/gravel-gateway USER $APP_USER EXPOSE 4278