- Copy the current checkout to the Dockerfile. - Add .dockerignore to exclude files while copying. - Test tip-of-tree build within CI. - Run the test suite outside the Docker image. - Perform extra sanity tests. - Switch to make commands for CircleCI. - Improve Docker README.
29 lines
819 B
Makefile
29 lines
819 B
Makefile
# A Makefile to build, test, tag and publish the Emscripten SDK Docker container.
|
|
|
|
# Emscripten version to build: Should match the version that has been already released.
|
|
# i.e.: 1.39.18
|
|
version =
|
|
alias =
|
|
|
|
image_name ?= emscripten/emsdk
|
|
|
|
.TEST:
|
|
ifndef version
|
|
$(error argument 'version' is not set. Please call `make version=SOME_VERSION ...`)
|
|
endif
|
|
|
|
build: Dockerfile .TEST
|
|
cd .. && docker build --network host --build-arg=EMSCRIPTEN_VERSION=${version} -t ${image_name}:${version} -f docker/$< .
|
|
|
|
test: test_dockerimage.sh .TEST
|
|
# test as non-root
|
|
docker run --rm -u `id -u`:`id -g` -w /emsdk/docker --net=host ${image_name}:${version} \
|
|
bash $<
|
|
|
|
push: .TEST
|
|
docker push ${image_name}:${version}
|
|
ifdef alias
|
|
docker tag ${image_name}:${version} ${image_name}:${alias}
|
|
docker push ${image_name}:${alias}
|
|
endif
|