From c132c86cf947ed31d849d8e4cbf7247767a54ea5 Mon Sep 17 00:00:00 2001 From: Nathaniel Filardo Date: Wed, 21 Apr 2021 15:11:13 +0100 Subject: [PATCH] ci/README: document how to test docker images locally While here, fix the `docker build` command: the images are named `build_${IMG}` while the ci files are just `ci/${IMG}`, no `build_` prefix. --- ci/README.md | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/ci/README.md b/ci/README.md index af29f7c..1614c79 100644 --- a/ci/README.md +++ b/ci/README.md @@ -2,13 +2,20 @@ ## Re-building an image after updating the docker file -Run `docker build -t snmallocciteam/$IMG:latest -f ci/$IMG .` from the root of the repo, -where `$IMG` is the image you want to rebuild, for example `build_linux_x64` +Run `docker build -t snmallocciteam/build_${IMG}:latest -f ci/${IMG} .` from the root of the repo, +where `$IMG` is the image you want to rebuild, for example `linux_x64` If you are building a multiarch image, ie. an image targeting an architecture other than the one you are running, you will need to install the qemu handler before you can build: `sudo docker run --rm --privileged multiarch/qemu-user-static:register --reset` +## Testing locally + +Having built a docker image, you can build your current tree therein with + + docker run --rm -u $(id -u) -v ${PWD}:/opt:ro snmallocciteam/build_${IMG}:latest \ + sh -c "cd /tmp; CC=clang-10 CXX=clang++-10 BUILD_TYPE=Debug SNMALLOC_SRC=/opt /opt/ci/scripts/build.sh && (cd build; ninja test)" + ## Pushing the updated docker image to Docker Hub Run `docker push snmallocciteam/$IMG:latest`