From 6f47b6f27dc9e089d46d9641cd375b68a8c3ac86 Mon Sep 17 00:00:00 2001 From: Mikhail Uvarov Date: Wed, 18 Sep 2024 11:06:00 +0200 Subject: [PATCH 1/2] Fix building docker image locally Was failing when checking mongooseim-docker --- doc/tutorials/Docker-build.md | 8 ++++++++ tools/circleci-prepare-mongooseim-docker.sh | 15 +++++++++++---- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/doc/tutorials/Docker-build.md b/doc/tutorials/Docker-build.md index 0db73874c22..1fce7da6df9 100644 --- a/doc/tutorials/Docker-build.md +++ b/doc/tutorials/Docker-build.md @@ -22,6 +22,14 @@ Alternatively, it is possible to build a docker image based on any commit availa ./tools/build-docker-from-remote.sh $COMMIT_HASH ``` +Check the image information: + +```bash +docker inspect docker.io/library/mongooseim +``` + +You can also push `"docker.io/library/mongooseim"` to some registry. + ## Running docker image Full tutorial on running a docker image is available on [mongooseim-docker](https://github.com/esl/mongooseim-docker) GitHub. Here only simple and one-node configuration will be presented. In order to run it execute: diff --git a/tools/circleci-prepare-mongooseim-docker.sh b/tools/circleci-prepare-mongooseim-docker.sh index 06341b54b7d..26339bc6dc6 100755 --- a/tools/circleci-prepare-mongooseim-docker.sh +++ b/tools/circleci-prepare-mongooseim-docker.sh @@ -17,7 +17,7 @@ if [ -n "$CIRCLE_PULL_REQUEST" ]; then # TODO: Possibly change it to something else during Tide integration PR_NUMBER=${CIRCLE_PULL_REQUEST##*/} DOCKERHUB_TAG="PR-${PR_NUMBER}" -elif [ ${CIRCLE_BRANCH} == 'master' ]; then +elif [ "${CIRCLE_BRANCH}" == 'master' ]; then DOCKERHUB_TAG="latest"; fi @@ -25,6 +25,13 @@ echo "Tag: ${DOCKERHUB_TAG}" export IMAGE_TAG=${DOCKERHUB_REPO}/mongooseim:${DOCKERHUB_TAG} -git clone https://github.com/esl/mongooseim-docker.git -cd mongooseim-docker -git checkout $MIM_DOCKER_VERSION +if [ -d mongooseim-docker ]; then + # We already have mongooseim-docker, just fetch the required version + cd mongooseim-docker + git fetch + git checkout "$MIM_DOCKER_VERSION" +else + git clone https://github.com/esl/mongooseim-docker.git + cd mongooseim-docker + git checkout "$MIM_DOCKER_VERSION" +fi From 3f7c2d7edf7a3d2b08d58eda30d57ed3c3407c6a Mon Sep 17 00:00:00 2001 From: Mikhail Uvarov Date: Wed, 18 Sep 2024 11:21:15 +0200 Subject: [PATCH 2/2] Skip removing mongooseim-docker --- tools/build-docker-from-remote.sh | 3 --- 1 file changed, 3 deletions(-) diff --git a/tools/build-docker-from-remote.sh b/tools/build-docker-from-remote.sh index f8b460fae2d..a9432246be6 100755 --- a/tools/build-docker-from-remote.sh +++ b/tools/build-docker-from-remote.sh @@ -24,6 +24,3 @@ docker rm -f $CID # Build a final image docker build -f Dockerfile.member -t mongooseim . - -cd .. -rm -rf mongooseim-docker