Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker Images Build Issue with -race flag / Problème de construction des images Docker avec le paramètre -race #416

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Publication Docker image

on: [push]

jobs:
docker:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Login Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
with:
platforms: all
- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v1
id: buildx
- name: Cache Docker Image Layers
uses: actions/cache@v2
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Build and Push Docker Image
uses: docker/build-push-action@v2
id: docker_build
with:
context: ./
file: ./Dockerfile
builder: ${{ steps.buildx.outputs.name }}
platforms: linux/amd64, linux/arm64, linux/aarch64
push: true
tags: ${{ secrets.DOCKER_USERNAME }}/imaginaryprototype:latest
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache,mode=max
- name: Verify
run: echo ${{ steps.docker_build.outputs.digest }}
4 changes: 3 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,9 @@ RUN go mod download
COPY . .

# Run quality control
RUN go test ./... -test.v -race -test.coverprofile=atomic .
# RUN go test ./... -test.v -race -test.coverprofile=atomic .
ARG TARGETPLATFORM
RUN if [ "$TARGETPLATFORM" = "linux/arm64" ] ; then go test ./... -test.v -test.coverprofile=atomic . ; else go test ./... -test.v -race -test.coverprofile=atomic . ; fi
RUN golangci-lint run .

# Compile imaginary
Expand Down