2022-09-13 17:55:17 +00:00
|
|
|
# Copyright 2021 The ChromiumOS Authors
|
2021-10-13 23:40:53 +00:00
|
|
|
# Use of this source code is governed by a BSD-style license that can be
|
|
|
|
# found in the LICENSE file.
|
|
|
|
#
|
|
|
|
# To locally build the docker container for usage with dev_container:
|
|
|
|
#
|
|
|
|
# make -C tools/impl/dev_container crosvm_dev
|
|
|
|
#
|
|
|
|
# To upload a new version of the container, uprev the `version` file and run;
|
|
|
|
#
|
|
|
|
# make -C tools/impl/dev_container upload
|
|
|
|
#
|
2022-06-10 22:14:14 +00:00
|
|
|
# You need to be a Googler to be able to do so. See go/crosvm/infra for access control and
|
|
|
|
# authenticate via:
|
|
|
|
#
|
|
|
|
# gcloud auth configure-docker gcr.io
|
2021-10-13 23:40:53 +00:00
|
|
|
|
|
|
|
export DOCKER_BUILDKIT=1
|
|
|
|
|
2022-06-10 22:14:14 +00:00
|
|
|
TAG_BASE=gcr.io/crosvm-infra
|
2021-10-13 23:40:53 +00:00
|
|
|
VERSION=$(shell cat version)
|
|
|
|
BUILD_CONTEXT=$(shell realpath ../../../)
|
|
|
|
|
|
|
|
DOCKER ?= docker
|
|
|
|
|
2022-10-21 21:51:51 +00:00
|
|
|
all: crosvm_dev crosvm_dev_user
|
2021-10-13 23:40:53 +00:00
|
|
|
|
|
|
|
upload: all
|
|
|
|
$(DOCKER) push $(TAG_BASE)/crosvm_dev:$(VERSION)
|
2022-10-21 21:51:51 +00:00
|
|
|
$(DOCKER) push $(TAG_BASE)/crosvm_dev_user:$(VERSION)
|
2021-10-13 23:40:53 +00:00
|
|
|
|
|
|
|
crosvm_dev:
|
|
|
|
$(DOCKER) build \
|
|
|
|
-t $(TAG_BASE)/$@:$(VERSION) \
|
|
|
|
-f Dockerfile \
|
|
|
|
$(BUILD_CONTEXT)
|
|
|
|
|
2022-10-21 21:51:51 +00:00
|
|
|
crosvm_dev_user:
|
|
|
|
$(DOCKER) build \
|
|
|
|
-t $(TAG_BASE)/$@:$(VERSION) \
|
|
|
|
-f Dockerfile.user \
|
|
|
|
--build-arg=VERSION=$(VERSION) \
|
|
|
|
$(BUILD_CONTEXT)
|
|
|
|
|
2021-10-13 23:40:53 +00:00
|
|
|
.PHONY: all crosvm_dev upload
|