Commit 6f08cde 1 parent c6a59c9 commit 6f08cde Copy full SHA for 6f08cde
File tree 2 files changed +25
-3
lines changed
2 files changed +25
-3
lines changed Original file line number Diff line number Diff line change 31
31
- name : Set up Docker Buildx
32
32
uses : docker/setup-buildx-action@v1
33
33
34
+ - name : Cache Docker layers
35
+ uses : actions/cache@v3
36
+ with :
37
+ path : /tmp/.buildx-cache
38
+ key : ${{ runner.os }}-buildx-${{ github.sha }}
39
+ restore-keys : |
40
+ ${{ runner.os }}-buildx-
41
+
34
42
- name : Get tags
35
43
id : tags
36
44
run : |
53
61
push : true
54
62
file : ./Dockerfile
55
63
tags : " ${{ steps.tags.outputs.value }}"
64
+ cache-from : type=local,src=/tmp/.buildx-cache
65
+ cache-to : type=local,dest=/tmp/.buildx-cache-new
66
+
67
+ # https://github.com/docker/build-push-action/issues/252
68
+ # https://github.com/moby/buildkit/issues/1896
69
+ - name : Move cache to limit growth
70
+ run : |
71
+ rm -rf /tmp/.buildx-cache
72
+ mv /tmp/.buildx-cache-new /tmp/.buildx-cache
Original file line number Diff line number Diff line change 1
- FROM golang:1.19.1-buster
1
+ FROM --platform=${BUILDPLATFORM:-linux/amd64} golang:1.19.1-buster
2
2
LABEL maintainer="Steven Allen <steven@stebalien.com>"
3
3
4
+ ARG TARGETPLATFORM
5
+ ARG BUILDPLATFORM
6
+ ARG TARGETOS
7
+ ARG TARGETARCH
8
+
4
9
# Install deps
5
10
RUN apt-get update && apt-get install -y \
6
11
libssl-dev \
@@ -24,7 +29,7 @@ ARG IPFS_PLUGINS
24
29
# Also: fix getting HEAD commit hash via git rev-parse.
25
30
RUN cd $SRC_DIR \
26
31
&& mkdir -p .git/objects \
27
- && GOFLAGS=-buildvcs=false make build GOTAGS=openssl IPFS_PLUGINS=$IPFS_PLUGINS
32
+ && GOOS=$TARGETOS GOARCH=$TARGETARCH GOFLAGS=-buildvcs=false make build GOTAGS=openssl IPFS_PLUGINS=$IPFS_PLUGINS
28
33
29
34
# Get su-exec, a very minimal tool for dropping privileges,
30
35
# and tini, a very minimal init daemon for containers
@@ -46,7 +51,7 @@ RUN set -eux; \
46
51
&& chmod +x tini
47
52
48
53
# Now comes the actual target image, which aims to be as small as possible.
49
- FROM busybox:1.31.1-glibc
54
+ FROM --platform=${BUILDPLATFORM:-linux/amd64} busybox:1.31.1-glibc
50
55
LABEL maintainer="Steven Allen <steven@stebalien.com>"
51
56
52
57
# Get the ipfs binary, entrypoint script, and TLS CAs from the build container.
You can’t perform that action at this time.
0 commit comments