[build]: insert overlay kmod for base image build
This commit is contained in:
parent
8d43f3b672
commit
8c72d8c6f2
3
Makefile
3
Makefile
@ -35,6 +35,7 @@ SLAVE_TAG = $(shell cat sonic-slave/Dockerfile.user sonic-slave/Dockerfile | sha
|
||||
SLAVE_BASE_IMAGE = sonic-slave-base
|
||||
SLAVE_IMAGE = sonic-slave-$(USER)
|
||||
|
||||
INSMOD_OVERLAY := sudo modprobe overlay
|
||||
DOCKER_RUN := docker run --rm=true --privileged \
|
||||
-v $(PWD):/sonic \
|
||||
-w /sonic \
|
||||
@ -86,6 +87,7 @@ SONIC_BUILD_INSTRUCTION := make \
|
||||
@docker inspect --type image $(SLAVE_IMAGE):$(SLAVE_TAG) &> /dev/null || \
|
||||
{ echo Image $(SLAVE_IMAGE):$(SLAVE_TAG) not found. Building... ; \
|
||||
$(DOCKER_BUILD) ; }
|
||||
@$(INSMOD_OVERLAY)
|
||||
ifeq "$(KEEP_SLAVE_ON)" "yes"
|
||||
ifdef SOURCE_FOLDER
|
||||
@$(DOCKER_RUN) -v $(SOURCE_FOLDER):/var/$(USER)/src $(SLAVE_IMAGE):$(SLAVE_TAG) bash -c "$(SONIC_BUILD_INSTRUCTION) $@; /bin/bash"
|
||||
@ -107,6 +109,7 @@ sonic-slave-bash :
|
||||
@docker inspect --type image $(SLAVE_IMAGE):$(SLAVE_TAG) &> /dev/null || \
|
||||
{ echo Image $(SLAVE_IMAGE):$(SLAVE_TAG) not found. Building... ; \
|
||||
$(DOCKER_BUILD) ; }
|
||||
@$(INSMOD_OVERLAY)
|
||||
@$(DOCKER_RUN) -t $(SLAVE_IMAGE):$(SLAVE_TAG) bash
|
||||
|
||||
showtag:
|
||||
|
@ -44,6 +44,7 @@ sudo LANG=C chroot $FILESYSTEM_ROOT mount sysfs /sys -t sysfs
|
||||
|
||||
sudo bash -c "echo \"DOCKER_OPTS=\"--storage-driver=overlay\"\" >> $FILESYSTEM_ROOT/etc/default/docker"
|
||||
sudo chroot $FILESYSTEM_ROOT service docker start
|
||||
sudo chroot $FILESYSTEM_ROOT docker info
|
||||
|
||||
# Apply apt configuration files
|
||||
sudo cp $IMAGE_CONFIGS/apt/sources.list $FILESYSTEM_ROOT/etc/apt/
|
||||
|
Loading…
Reference in New Issue
Block a user