[build]: add sonic-slave-run target to run any cmds inside sonic-slave-docekr (#4481)
example: ``` SONIC_RUN_CMDS="gzip -d -c target/sonic-vs.img.gz > target/sonic-vs.img;\ qemu-img convert target/sonic-vs.img -O vhdx -o subformat=dynamic target/sonic-vs.vhdx"\ BLDENV=buster make -f Makefile.work sonic-slave-run ``` Signed-off-by: Guohan Lu <lguohan@gmail.com>
This commit is contained in:
parent
4adf243260
commit
c56752a5f8
@ -251,6 +251,16 @@ sonic-slave-bash :
|
||||
$(DOCKER_BUILD) ; }
|
||||
@$(DOCKER_RUN) -t $(SLAVE_IMAGE):$(SLAVE_TAG) bash
|
||||
|
||||
sonic-slave-run :
|
||||
@$(OVERLAY_MODULE_CHECK)
|
||||
@docker inspect --type image $(SLAVE_BASE_IMAGE):$(SLAVE_BASE_TAG) &> /dev/null || \
|
||||
{ echo Image $(SLAVE_BASE_IMAGE):$(SLAVE_BASE_TAG) not found. Building... ; \
|
||||
$(DOCKER_BASE_BUILD) ; }
|
||||
@docker inspect --type image $(SLAVE_IMAGE):$(SLAVE_TAG) &> /dev/null || \
|
||||
{ echo Image $(SLAVE_IMAGE):$(SLAVE_TAG) not found. Building... ; \
|
||||
$(DOCKER_BUILD) ; }
|
||||
@$(DOCKER_RUN) -t $(SLAVE_IMAGE):$(SLAVE_TAG) bash -c "$(SONIC_RUN_CMDS)"
|
||||
|
||||
showtag:
|
||||
@echo $(SLAVE_IMAGE):$(SLAVE_TAG)
|
||||
@echo $(SLAVE_BASE_IMAGE):$(SLAVE_BASE_TAG)
|
||||
|
Reference in New Issue
Block a user