diff --git a/build/common.sh b/build/common.sh index a6d988488..fcb87db69 100644 --- a/build/common.sh +++ b/build/common.sh @@ -47,8 +47,9 @@ function start_rsync_container() { -e MKDIRS="/volume/go/src/${source_repo}" \ -p ${rsync_port}:873 \ -v ${container_volume}:/volume \ + --entrypoint "/tini" \ ${container_image} \ - /build/rsyncd.sh + -- /build/rsyncd.sh } function wait_for_rsync() { diff --git a/build/run b/build/run index e017de2c2..c3b98dddf 100755 --- a/build/run +++ b/build/run @@ -25,17 +25,15 @@ if [ ! -z $DOCKER_HOST ]; then fi # build the the container if we've not done so already -if [[ -z "$(docker images -q ${container_image})" ]]; then - echo ==== building the cross container \(this could take minutes the first time\) - make_cmd="make --no-print-directory -C ${scriptdir}/../images cross.amd64 PULL=0" - make_output=$($make_cmd 2>&1) || { - cat <&2 +echo ==== building the cross container \(this could take minutes the first time\) +make_cmd="make --no-print-directory -C ${scriptdir}/../images cross.amd64 PULL=0" +make_output=$($make_cmd 2>&1) || { + cat <&2 === cross build image failed for ${container_image} ${make_output} EOF - exit 1 + exit 1 } -fi # run the container with the same uid and gid of the user to avoid # permissions issues when sharing volumes with the host diff --git a/images/cross/Dockerfile b/images/cross/Dockerfile index 043e2d1e2..343d5ccdc 100644 --- a/images/cross/Dockerfile +++ b/images/cross/Dockerfile @@ -40,4 +40,6 @@ RUN ACBUILD_VERSION=0.4.0 && \ rm -f docker2aci-v${DOCKER2ACI_VERSION}.tar.gz COPY run.sh rsyncd.sh /build/ -CMD [ "/build/run.sh" ] + +ENTRYPOINT [ "/tini", "--", "/build/run.sh" ] +CMD ["/bin/bash"] diff --git a/images/rookd/Dockerfile b/images/rookd/Dockerfile index a0ca30164..1d1400c5a 100644 --- a/images/rookd/Dockerfile +++ b/images/rookd/Dockerfile @@ -16,4 +16,5 @@ FROM BASEIMAGE ADD rookd /usr/local/bin/ -CMD ["/usr/local/bin/rookd"] +ENTRYPOINT ["/tini", "--", "/usr/local/bin/rookd"] +CMD [""] diff --git a/images/toolbox/Dockerfile b/images/toolbox/Dockerfile index d51a9671a..3649609a7 100644 --- a/images/toolbox/Dockerfile +++ b/images/toolbox/Dockerfile @@ -14,8 +14,7 @@ FROM BASEIMAGE -COPY rook /usr/local/bin +COPY rook toolbox.sh /usr/local/bin/ -COPY toolbox.sh /toolbox/ - -CMD [ "/toolbox/toolbox.sh" ] +ENTRYPOINT ["/tini", "--", "/usr/local/bin/toolbox.sh"] +CMD ["/bin/bash"]