To update both base image and dev image, we need to build and upload a base image before building a dev image because a newer base image should be downloaded from the cloud while building the new dev image. So, we add separate targets for uploading base/dev image in containers' Makefile. BUG=none TEST=upload containers Change-Id: I0d26636fb30bee6a4060cd46fc1c7b89020fd1c2 Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/7090809 Commit-Queue: Zihan Chen <zihanchen@google.com> Auto-Submit: Keiichi Watanabe <keiichiw@chromium.org> Commit-Queue: Keiichi Watanabe <keiichiw@chromium.org> Reviewed-by: Zihan Chen <zihanchen@google.com>
38 lines
1.1 KiB
Makefile
38 lines
1.1 KiB
Makefile
# Copyright 2021 The ChromiumOS Authors
|
|
# Use of this source code is governed by a BSD-style license that can be
|
|
# found in the LICENSE file.
|
|
|
|
export DOCKER_BUILDKIT=1
|
|
|
|
TAG_BASE=gcr.io/crosvm-infra
|
|
VERSION=$(shell cat version)
|
|
BASE_VERSION=$(shell cat base_version)
|
|
BUILD_CONTEXT=$(shell realpath ../../../)
|
|
|
|
DOCKER ?= podman
|
|
|
|
crosvm_dev:
|
|
$(DOCKER) pull $(TAG_BASE)/crosvm_dev_base:$(BASE_VERSION)
|
|
$(DOCKER) build \
|
|
-t $(TAG_BASE)/$@:$(VERSION) \
|
|
-f Dockerfile \
|
|
--build-arg BASE_VERSION=$(BASE_VERSION) \
|
|
$(BUILD_CONTEXT)
|
|
$(DOCKER) tag $(TAG_BASE)/$@:$(VERSION) $(TAG_BASE)/$@:latest
|
|
|
|
upload_dev: crosvm_dev
|
|
$(DOCKER) push $(TAG_BASE)/crosvm_dev:$(VERSION)
|
|
$(DOCKER) push $(TAG_BASE)/crosvm_dev:latest
|
|
|
|
crosvm_dev_base:
|
|
$(DOCKER) build \
|
|
-t $(TAG_BASE)/$@:$(BASE_VERSION) \
|
|
-f Dockerfile.base \
|
|
$(BUILD_CONTEXT)
|
|
$(DOCKER) tag $(TAG_BASE)/$@:$(BASE_VERSION) $(TAG_BASE)/$@:latest
|
|
|
|
upload_base: crosvm_dev_base
|
|
$(DOCKER) push $(TAG_BASE)/crosvm_dev_base:$(BASE_VERSION)
|
|
$(DOCKER) push $(TAG_BASE)/crosvm_dev_base:latest
|
|
|
|
.PHONY: all crosvm_dev crosvm_dev_base upload_dev upload_base
|