Skip to content

Commit 1c3f240

Browse files
committed
Exclude _submodules/firecracker from the build context
After having Linux kernel under, _submodules/firecracker is getting too big to include in the build context. https://docs.docker.com/develop/develop-images/dockerfile_best-practices/#understand-build-context Signed-off-by: Kazuyoshi Kato <[email protected]>
1 parent 3f792eb commit 1c3f240

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

.dockerignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
11
tools/image-builder/rootfs/
22
tmp/
3+
4+
_submodules/firecracker/
5+
!_submodules/firecracker/build/kernel/linux-4.14/*.bin

Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ endif
4646
FIRECRACKER_TARGET?=$(host_arch)-unknown-linux-musl
4747

4848
FIRECRACKER_DIR=$(SUBMODULES)/firecracker
49-
FIRECRACKER_BIN=$(FIRECRACKER_DIR)/build/cargo_target/$(FIRECRACKER_TARGET)/release/firecracker
49+
FIRECRACKER_BIN=bin/firecracker
5050
FIRECRACKER_BUILDER_NAME?=firecracker-builder
5151
CARGO_CACHE_VOLUME_NAME?=cargocache
5252

@@ -337,6 +337,7 @@ $(FIRECRACKER_DIR)/Cargo.toml:
337337
$(FIRECRACKER_BIN): $(FIRECRACKER_DIR)/Cargo.toml
338338
$(FIRECRACKER_DIR)/tools/devtool -y build --release && \
339339
$(FIRECRACKER_DIR)/tools/devtool strip
340+
cp $(FIRECRACKER_DIR)/build/cargo_target/$(FIRECRACKER_TARGET)/release/firecracker $@
340341

341342
.PHONY: firecracker-clean
342343
firecracker-clean:

tools/docker/Dockerfile.integ-test

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,12 @@ RUN wget https://github.com/kubernetes-sigs/cri-tools/releases/download/$VERSION
5656
install -D -o root -g root -m755 -t /usr/local/bin /tmp/critest && \
5757
rm -f critest-$VERSION-linux-amd64.tar.gz /tmp/critest
5858

59+
ADD bin/firecracker /usr/local/bin
60+
5961
# Install everything we need in this image. Due to the bind-mount, if the host has already
6062
# up-to-date versions of everything built, this step will be a very quick copy
6163
RUN --mount=type=bind,target=/src make -C /src \
6264
install \
63-
install-firecracker \
6465
install-runc \
6566
install-kernel \
6667
install-default-rootfs \

0 commit comments

Comments
 (0)