Skip to content

Commit 30df723

Browse files
authored
Merge pull request #4377 from esl/fix-docker-local-build
Fix building docker image locally
2 parents fc86296 + 3f7c2d7 commit 30df723

File tree

3 files changed

+19
-7
lines changed

3 files changed

+19
-7
lines changed

Diff for: doc/tutorials/Docker-build.md

+8
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,14 @@ Alternatively, it is possible to build a docker image based on any commit availa
2222
./tools/build-docker-from-remote.sh $COMMIT_HASH
2323
```
2424

25+
Check the image information:
26+
27+
```bash
28+
docker inspect docker.io/library/mongooseim
29+
```
30+
31+
You can also push `"docker.io/library/mongooseim"` to some registry.
32+
2533
## Running docker image
2634

2735
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 for: tools/build-docker-from-remote.sh

-3
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,3 @@ docker rm -f $CID
2424

2525
# Build a final image
2626
docker build -f Dockerfile.member -t mongooseim .
27-
28-
cd ..
29-
rm -rf mongooseim-docker

Diff for: tools/circleci-prepare-mongooseim-docker.sh

+11-4
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,21 @@ if [ -n "$CIRCLE_PULL_REQUEST" ]; then
1717
# TODO: Possibly change it to something else during Tide integration
1818
PR_NUMBER=${CIRCLE_PULL_REQUEST##*/}
1919
DOCKERHUB_TAG="PR-${PR_NUMBER}"
20-
elif [ ${CIRCLE_BRANCH} == 'master' ]; then
20+
elif [ "${CIRCLE_BRANCH}" == 'master' ]; then
2121
DOCKERHUB_TAG="latest";
2222
fi
2323

2424
echo "Tag: ${DOCKERHUB_TAG}"
2525

2626
export IMAGE_TAG=${DOCKERHUB_REPO}/mongooseim:${DOCKERHUB_TAG}
2727

28-
git clone https://github.com/esl/mongooseim-docker.git
29-
cd mongooseim-docker
30-
git checkout $MIM_DOCKER_VERSION
28+
if [ -d mongooseim-docker ]; then
29+
# We already have mongooseim-docker, just fetch the required version
30+
cd mongooseim-docker
31+
git fetch
32+
git checkout "$MIM_DOCKER_VERSION"
33+
else
34+
git clone https://github.com/esl/mongooseim-docker.git
35+
cd mongooseim-docker
36+
git checkout "$MIM_DOCKER_VERSION"
37+
fi

0 commit comments

Comments
 (0)