提交 eacc3267 编写于 作者: M Maxime Vidori

Dockerized build:

	$ make buildroot-image
	$ make out/minikube.iso

- Add en entry in the Makefile for building the container: buildroot-image
- Modify the minikube-iso target to out/minikube.iso to comply with the way
makefiles work.
- Also force the use of a docker container. If not needed
just run IN_DOCKER=1 make out/minikube.iso to avoid the invokation of a docker
container.
- Add some doc.
- The tag added to the generated image will allow to bypass the build of the
image as soon as the container is pushed to the minikube registry.
上级 12e41aea
......@@ -22,6 +22,7 @@ INSTALL_SIZE ?= $(shell du out/minikube-windows-amd64.exe | cut -f1)
BUILDROOT_BRANCH ?= 2016.08
REGISTRY?=gcr.io/k8s-minikube
DARWIN_BUILD_IMAGE ?= karalabe/xgo-1.7.3
ISO_BUILD_IMAGE ?= $(REGISTRY)/buildroot-image
ISO_VERSION ?= v1.0.7
ISO_BUCKET ?= minikube/iso
......@@ -85,7 +86,7 @@ out/minikube-linux-amd64: $(GOPATH)/src/$(ORG) pkg/minikube/assets/assets.go $(s
out/minikube-windows-amd64.exe: $(GOPATH)/src/$(ORG) pkg/minikube/assets/assets.go $(shell $(MINIKUBEFILES))
CGO_ENABLED=0 GOARCH=amd64 GOOS=windows go build --installsuffix cgo -ldflags="$(MINIKUBE_LDFLAGS) $(K8S_VERSION_LDFLAGS)" -a -o $(BUILD_DIR)/minikube-windows-amd64.exe k8s.io/minikube/cmd/minikube
minikube_iso:
minikube_iso: # old target kept for making tests happy
echo $(ISO_VERSION) > deploy/iso/minikube-iso/board/coreos/minikube/rootfs-overlay/etc/VERSION
if [ ! -d $(BUILD_DIR)/buildroot ]; then \
mkdir -p $(BUILD_DIR); \
......@@ -95,6 +96,15 @@ minikube_iso:
$(MAKE) -C $(BUILD_DIR)/buildroot
mv $(BUILD_DIR)/buildroot/output/images/rootfs.iso9660 $(BUILD_DIR)/minikube.iso
out/minikube.iso: $(shell find deploy/iso/minikube-iso -type f)
ifeq ($(IN_DOCKER),1)
$(MAKE) minikube_iso
else
docker run --rm --workdir /mnt --volume $(CURDIR):/mnt \
--user $(shell id -u):$(shell id -g) --env HOME=/tmp --env IN_DOCKER=1 \
$(ISO_BUILD_IMAGE) /usr/bin/make out/minikube.iso
endif
test-iso:
go test -v $(REPOPATH)/test/integration --tags=iso --minikube-args="--iso-url=file://$(shell pwd)/out/buildroot/output/images/rootfs.iso9660"
......@@ -175,16 +185,22 @@ release-localkube: out/localkube checksum
gsutil cp out/localkube.sha256 $(LOCALKUBE_BUCKET)/$(LOCALKUBE_VERSION)/localkube-linux-amd64.sha256
.PHONY: update-releases
update-releases:
update-releases:
gsutil cp deploy/minikube/k8s_releases.json gs://minikube/k8s_releases.json
out/localkube-image: out/localkube
localkube-image: out/localkube
# TODO(aprindle) make addons placed into container configurable
docker build -t $(REGISTRY)/localkube-image:$(TAG) -f deploy/docker/Dockerfile .
@echo ""
@echo "${REGISTRY}/localkube-image:$(TAG) succesfully built"
@echo "See https://github.com/kubernetes/minikube/tree/master/deploy/docker for instrucions on how to run image"
buildroot-image: $(ISO_BUILD_IMAGE) # convenient alias to build the docker container
$(ISO_BUILD_IMAGE): deploy/iso/minikube-iso/Dockerfile
docker build -t $@ -f $< $(dir $<)
@echo ""
@echo "$(@) succesfully built"
.PHONY: release-iso
release-iso: minikube_iso checksum
gsutil cp out/minikube.iso gs://$(ISO_BUCKET)/minikube-$(ISO_VERSION).iso
......
# Copyright 2016 The Kubernetes Authors All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# Beware ubuntu:16.10 and debian:testing have been tested and failed
FROM ubuntu:16.04
RUN apt-get update && apt-get install -y \
build-essential \
git \
wget \
cpio \
python \
unzip \
bc \
gcc-multilib \
automake \
libtool \
gnupg2 \
p7zip-full \
locales \
&& rm -rf /var/lib/apt/lists/*
RUN localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8
ENV LANG en_US.utf8
# dumb init will allow us to interrupt the build with ^C
RUN wget -O - https://github.com/Yelp/dumb-init/archive/v1.2.0.tar.gz | tar xvzf - \
&& make -C dumb-init-1.2.0 \
&& mv dumb-init-1.2.0/dumb-init /usr/bin \
&& rm -rf dumb-init-1.2.0
ENTRYPOINT ["/usr/bin/dumb-init", "--"]
CMD ["/bin/bash"]
......@@ -42,9 +42,12 @@ Also be sure to have an UTF-8 locale set up in order to build the ISO.
```
$ git clone https://github.com/kubernetes/minikube
$ cd minikube
$ make minikube_iso
$ make buildroot-image
$ make out/minikube.iso
```
The build will occurs inside a docker container, if you want to do this
baremetal, replace `make out/minikube.iso` with `IN_DOCKER=1 make out/minikube.iso`.
The bootable ISO image will be available in `out/minikube.iso`.
### Testing local minikube-iso changes
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册