In order to build the artifacts in SONiC, we always need some specific environment, for convenient, we build them in some docker container. The docker container defined in repo sonic-buildimage After the build process, the build-docker will be deleted. But we might need some docker environment for building something, like debug code.
Then we might need to get a build-docker in local environment
- Check out sonic-buildimage repo
- Go through the doc, to understand the build system.
- Choice a target (for different purposes, the command might be different)
# build EOS image
make target/sonic-aboot-broadcom.swi
# example:
make configure PLATFORM=marvell-armhf PLATFORM_ARCH=armhf
make target/sonic-marvell-armhf.bin
- Add the parameters KEEP_SLAVE_ON when build the target docker
- Commit the build docker to local image repository Then you can use the docker command to save the docker to a local image
docker commit [OPTIONS] CONTAINER [REPOSITORY[:TAG]]
Example: musing_payne is the docker name, slave-syncd-4334 is the local image name, 0.0.1 is the image tag
docker commit musing_payne slave-syncd-4334:0.0.1
- Then you can use the local commit docker for other SAI related buildings
Here is a example Example: Check sonic version and get a related builder