Skip to content

Commit

Permalink
Merge pull request #4377 from esl/fix-docker-local-build
Browse files Browse the repository at this point in the history
Fix building docker image locally
  • Loading branch information
chrzaszcz authored Sep 19, 2024
2 parents fc86296 + 3f7c2d7 commit 30df723
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 7 deletions.
8 changes: 8 additions & 0 deletions doc/tutorials/Docker-build.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
3 changes: 0 additions & 3 deletions tools/build-docker-from-remote.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,3 @@ docker rm -f $CID

# Build a final image
docker build -f Dockerfile.member -t mongooseim .

cd ..
rm -rf mongooseim-docker
15 changes: 11 additions & 4 deletions tools/circleci-prepare-mongooseim-docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,21 @@ 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

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

0 comments on commit 30df723

Please sign in to comment.