Browse Source

ci(dockerfile): clean pkg cache

jguer 4 years ago
parent
commit
a80771c37e
2 changed files with 17 additions and 8 deletions
  1. 15 7
      .github/workflows/builder-image.yml
  2. 2 1
      ci.Dockerfile

+ 15 - 7
.github/workflows/builder-image.yml

@@ -9,16 +9,24 @@ on:
       - "**/builder-image.yml"
 jobs:
   build:
-    name: Push builder image to GitHub Packages
+    name: Push builder image to Docker Hub
     runs-on: ubuntu-latest
     steps:
-      - name: Check out the repo
+      - name: Checkout
         uses: actions/checkout@v2
-      - name: Push to GitHub Packages
-        uses: docker/build-push-action@v1
+      - name: Set up QEMU
+        uses: docker/setup-qemu-action@v1
+      - name: Set up Docker Buildx
+        uses: docker/setup-buildx-action@v1
+      - name: Login to DockerHub
+        uses: docker/login-action@v1
         with:
           username: ${{ secrets.DOCKER_USERNAME }}
           password: ${{ secrets.DOCKER_PASSWORD }}
-          repository: jguer/yay-builder
-          dockerfile: ci.Dockerfile
-          tags: latest
+      - name: Push to Docker Hub
+        uses: docker/build-push-action@v2
+        with:
+          platforms: linux/amd64, linux/arm/v6,linux/arm/v7,linux/arm64
+          file: ci.Dockerfile
+          push: true
+          tags: jguer/yay-builder:latest

+ 2 - 1
ci.Dockerfile

@@ -4,7 +4,8 @@ LABEL maintainer="Jguer,joaogg3 at google mail"
 ENV GO111MODULE=on
 WORKDIR /app
 
-RUN pacman -Syu --overwrite=* --needed --noconfirm go fakeroot binutils gcc make git
+RUN pacman -Syu --overwrite=* --needed --noconfirm go fakeroot binutils gcc make git &&\
+    rm -rfv /var/cache/pacman/* /var/lib/pacman/sync/*
 
 RUN curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s v1.31.0