File tree 7 files changed +65
-1
lines changed
7 files changed +65
-1
lines changed Original file line number Diff line number Diff line change 27
27
- uses : actions/setup-python@v4
28
28
with :
29
29
python-version : ${{ matrix.python-version }}
30
+ - uses : crazy-max/ghaction-setup-docker@v3
31
+ with :
32
+ daemon-config : |
33
+ {
34
+ "features": {
35
+ "containerd-snapshotter": true
36
+ }
37
+ }
38
+ - uses : docker/setup-buildx-action@v3
39
+ with :
40
+ install : true
41
+ driver : docker
42
+ # Required for multi-platform builds
43
+ - name : Setup QEMU
44
+ uses : docker/setup-qemu-action@v3
45
+ with :
46
+ platforms : linux/amd64,linux/arm64
47
+ # Exposes Github env vars needed for docker caching - see https://github.com/orgs/community/discussions/42856
48
+ - name : Expose GitHub Runtime
49
+ uses : crazy-max/ghaction-github-runtime@v3
30
50
- uses : pantsbuild/actions/init-pants@v5-scie-pants
31
51
# This action bootstraps pants and manages 2-3 GHA caches.
32
52
# See: github.com/pantsbuild/actions/tree/main/init-pants/
58
78
env :
59
79
DYNAMIC_TAG : workflow
60
80
run : |
61
- pants package ::
81
+ pants --docker-build-verbose package ::
62
82
- name : Upload Pants log
63
83
uses : actions/upload-artifact@v3
64
84
with :
Original file line number Diff line number Diff line change @@ -28,3 +28,11 @@ interpreter_constraints = ["==3.8.*"]
28
28
29
29
[python-infer ]
30
30
use_rust_parser = true
31
+
32
+ [docker ]
33
+ env_vars = [
34
+ " ACTIONS_CACHE_URL" ,
35
+ " ACTIONS_RUNTIME_TOKEN" ,
36
+ " DYNAMIC_TAG" ,
37
+ ]
38
+ use_buildx =true
Original file line number Diff line number Diff line change
1
+ # Copyright 2022 Pants project contributors.
2
+ # Licensed under the Apache License, Version 2.0 (see LICENSE).
3
+
4
+ docker_image (
5
+ name = "with-gha-cache-backend" ,
6
+ cache_to = {"type" : "gha" , "mode" : "max" },
7
+ cache_from = {"type" : "gha" },
8
+ )
Original file line number Diff line number Diff line change
1
+ FROM alpine@sha256:21a3deaa0d32a8057914f36584b5288d2e5ecc984380bc0118285c70fa8c9300
2
+
3
+ RUN echo "hello" > msg.txt && \
4
+ sleep 60
Original file line number Diff line number Diff line change
1
+ # Note that multistage buildx builds requires using the containerd image store, due to
2
+ # limitations with the docker-container driver (https://github.com/moby/buildkit/issues/2343)
3
+
4
+ docker_image (
5
+ name = "multiplatform-base" ,
6
+ source = "Dockerfile.base" ,
7
+ skip_push = True ,
8
+ build_platform = ["linux/amd64" , "linux/arm64" ],
9
+ )
10
+
11
+ docker_image (
12
+ name = "multiplatform-final" ,
13
+ source = "Dockerfile.final" ,
14
+ build_platform = ["linux/amd64" , "linux/arm64" ],
15
+ )
Original file line number Diff line number Diff line change
1
+ FROM python:3.8
2
+
3
+ RUN echo "base image" >> base.txt
Original file line number Diff line number Diff line change
1
+ ARG PARENT=:multiplatform-base
2
+ # hadolint ignore=DL3006
3
+ FROM ${PARENT}
4
+
5
+ RUN cat base.txt && \
6
+ echo "final image" >> final.txt
You can’t perform that action at this time.
0 commit comments