|
12 | 12 | # See the License for the specific language governing permissions and
|
13 | 13 | # limitations under the License.
|
14 | 14 |
|
| 15 | +include ../../hack/make-rules/Makefile.manifest |
| 16 | +include ../../hack/make-rules/BASEIMAGES |
| 17 | + |
15 | 18 | .PHONY: all test-image-user-uid test-image-user-username test-image-user-uid-group test-image-user-username-group
|
16 | 19 |
|
| 20 | +REGISTRY = gcr.io/cri-tools |
| 21 | +ALL_ARCH = amd64 arm arm64 ppc64le s390x |
| 22 | +TAG = latest |
| 23 | +IMAGES_LIST = test-image-user-uid test-image-user-username test-image-user-uid-group test-image-user-username-group |
| 24 | + |
17 | 25 | all: test-image-user-uid test-image-user-username test-image-user-uid-group test-image-user-username-group
|
18 | 26 |
|
19 | 27 | test-image-user-uid:
|
20 |
| - docker build . -t gcr.io/cri-tools/$@ --build-arg USER=1002 |
21 |
| - gcloud docker -- push gcr.io/cri-tools/$@ |
| 28 | + $(foreach arch,$(ALL_ARCH),docker build . -t $(REGISTRY)/$@-$(arch) --build-arg ARCH=$($(arch)) --build-arg USER=1002;) |
| 29 | + $(foreach arch,$(ALL_ARCH),docker push $(REGISTRY)/$@-$(arch);) |
22 | 30 |
|
23 | 31 | test-image-user-username:
|
24 |
| - docker build . -t gcr.io/cri-tools/$@ --build-arg USER=www-data |
25 |
| - gcloud docker -- push gcr.io/cri-tools/$@ |
| 32 | + $(foreach arch,$(ALL_ARCH),docker build . -t $(REGISTRY)/$@-$(arch) --build-arg ARCH=$($(arch)) --build-arg USER=www-data;) |
| 33 | + $(foreach arch,$(ALL_ARCH),docker push $(REGISTRY)/$@-$(arch);) |
| 34 | + |
26 | 35 |
|
27 | 36 | test-image-user-uid-group:
|
28 |
| - docker build . -t gcr.io/cri-tools/$@ --build-arg USER=1003:users |
29 |
| - gcloud docker -- push gcr.io/cri-tools/$@ |
| 37 | + $(foreach arch,$(ALL_ARCH),docker build . -t $(REGISTRY)/$@-$(arch) --build-arg ARCH=$($(arch)) --build-arg USER=1003:users ;) |
| 38 | + $(foreach arch,$(ALL_ARCH),docker push $(REGISTRY)/$@-$(arch);) |
30 | 39 |
|
31 | 40 | test-image-user-username-group:
|
32 |
| - docker build . -t gcr.io/cri-tools/$@ --build-arg USER=www-data:100 |
33 |
| - gcloud docker -- push gcr.io/cri-tools/$@ |
| 41 | + $(foreach arch,$(ALL_ARCH),docker build . -t $(REGISTRY)/$@-$(arch) --build-arg ARCH=$($(arch)) --build-arg USER=www-data:100 ;) |
| 42 | + $(foreach arch,$(ALL_ARCH),docker push $(REGISTRY)/$@-$(arch);) |
| 43 | + |
| 44 | +push-manifest: manifest-tool |
| 45 | + $(foreach image,$(IMAGES_LIST),manifest-tool push from-args --platforms $(call join_platforms,$(ALL_ARCH)) --template $(REGISTRY)/$(image)-ARCH:$(TAG) --target $(REGISTRY)/$(image):$(TAG);) |
0 commit comments