• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright 2021 The ChromiumOS Authors
2# Use of this source code is governed by a BSD-style license that can be
3# found in the LICENSE file.
4#
5# To locally build the docker container for usage with dev_container:
6#
7# 	make -C tools/impl/dev_container crosvm_dev
8#
9# To upload a new version of the container, uprev the `version` file and run;
10#
11# 	make -C tools/impl/dev_container upload
12#
13# You need to be a Googler to be able to do so. See go/crosvm/infra for access control and
14# authenticate via:
15#
16#   gcloud auth configure-docker gcr.io
17
18export DOCKER_BUILDKIT=1
19
20TAG_BASE=gcr.io/crosvm-infra
21VERSION=$(shell cat version)
22BUILD_CONTEXT=$(shell realpath ../../../)
23
24DOCKER ?= docker
25
26all: crosvm_dev crosvm_dev_user
27
28upload: all
29	$(DOCKER) push $(TAG_BASE)/crosvm_dev:$(VERSION)
30	$(DOCKER) push $(TAG_BASE)/crosvm_dev:latest
31	$(DOCKER) push $(TAG_BASE)/crosvm_dev_user:$(VERSION)
32	$(DOCKER) push $(TAG_BASE)/crosvm_dev_user:latest
33
34crosvm_dev:
35	$(DOCKER) build \
36		-t $(TAG_BASE)/$@:$(VERSION) \
37		-f Dockerfile \
38		$(BUILD_CONTEXT)
39	$(DOCKER) tag $(TAG_BASE)/$@:$(VERSION) $(TAG_BASE)/$@:latest
40
41crosvm_dev_user:
42	$(DOCKER) build \
43		-t $(TAG_BASE)/$@:$(VERSION) \
44		-f Dockerfile.user \
45		--build-arg=VERSION=$(VERSION) \
46		$(BUILD_CONTEXT)
47	$(DOCKER) tag $(TAG_BASE)/$@:$(VERSION) $(TAG_BASE)/$@:latest
48
49.PHONY: all crosvm_dev upload
50