1# Copyright 2021 The Chromium OS Authors. All rights reserved. 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 write permission to the crosvm-packages cloud registry to do so. 14 15export DOCKER_BUILDKIT=1 16 17TAG_BASE=gcr.io/crosvm-packages 18VERSION=$(shell cat version) 19RUST_VERSION=$(shell cat ../../../rust-toolchain | grep channel | grep -E -o "[0-9\.]+") 20BUILD_CONTEXT=$(shell realpath ../../../) 21 22DOCKER ?= docker 23 24all: crosvm_dev 25 26upload: all 27 $(DOCKER) push $(TAG_BASE)/crosvm_dev:$(VERSION) 28 29crosvm_dev: 30 $(DOCKER) build \ 31 --build-arg RUST_VERSION=$(RUST_VERSION) \ 32 -t $(TAG_BASE)/$@:$(VERSION) \ 33 -f Dockerfile \ 34 $(BUILD_CONTEXT) 35 36.PHONY: all crosvm_dev upload 37