Skip to content

Commit

Permalink
fix(build/doc): update dockerfile and readme (bytebeamio#631)
Browse files Browse the repository at this point in the history
* fix(Dockerfile): don't include default config because its part of binary

* fix(docs): add instruction about how to pass custom config to docker

* update root readme as well
  • Loading branch information
henil authored Jun 3, 2023
1 parent 9c28463 commit 27a3802
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 7 deletions.
1 change: 0 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,5 @@ RUN cargo build --release -p rumqttd

FROM alpine:latest
COPY --from=builder /usr/src/rumqtt/target/release/rumqttd /usr/local/bin/rumqttd
COPY ./rumqttd/rumqttd.toml .
ENV RUST_LOG="info"
ENTRYPOINT ["rumqttd"]
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,14 @@ rumqttd can be used with docker by pulling the image from docker hub as follows:
docker pull bytebeamio/rumqttd
```

To use the rumqttd docker image with the included `rumqttd.toml` while exposing the necessary ports for clients to interact with the broker, use the following command:
To run rumqttd docker image you can simply run:
```bash
docker run -p 1883:1883 -p 1884:1884 -it bytebeamio/rumqttd -c rumqttd.toml
docker run -p 1883:1883 -p 1884:1884 -it bytebeamio/rumqttd
```

One can also mount the local directory containing configs as a volume and use the appropriate config file as follows:
Or you can run `rumqttd` with the custom config file by mounting the file and passing it as argument:
```bash
docker run -v /path/to/configs:/configs -p 1883:1883 -it bytebeamio/rumqttd -c /configs/config.toml
docker run -p 1883:1883 -p 1884:1884 -v /absolute/path/to/rumqttd.toml:/rumqttd.toml -it rumqttd -c /rumqttd.toml
```

<br/>
Expand Down
12 changes: 10 additions & 2 deletions rumqttd/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,18 @@ Example config file is provided on the root of the repo.

#### Building the docker image

In order to run rumqttd within a docker container, build the image by running `build_rumqttd_docker.sh` from the project's root directory. The shell script will use docker to build rumqttd and package it along in an [alpine](https://hub.docker.com/_/alpine) image. You can then run `rumqttd` with the included `rumqttd.toml` as follows(ensure you are in the project's root directory):
In order to run rumqttd within a docker container, build the image by running `build_rumqttd_docker.sh` from the project's root directory. The shell script will use docker to build rumqttd and package it along in an [alpine](https://hub.docker.com/_/alpine) image. You can then run `rumqttd` using default config with:

```bash
./build_rumqttd_docker.sh
docker run -p 1883:1883 -p 1884:1884 -it rumqttd
```

Or you can run `rumqttd` with the custom config file by mounting the file and passing it as argument:

```bash
./build_rumqttd_docker.sh
docker run -p 1883:1883 -p 1884:1884 -it rumqttd -c rumqttd.toml
docker run -p 1883:1883 -p 1884:1884 -v /absolute/path/to/rumqttd.toml:/rumqttd.toml -it rumqttd -c /rumqttd.toml
```

# How to use with TLS
Expand Down

0 comments on commit 27a3802

Please sign in to comment.