Skip to content

Commit 27a3802

Browse files
authoredJun 3, 2023
fix(build/doc): update dockerfile and readme (#631)
* 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
1 parent 9c28463 commit 27a3802

File tree

3 files changed

+14
-7
lines changed

3 files changed

+14
-7
lines changed
 

‎Dockerfile

-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,5 @@ RUN cargo build --release -p rumqttd
66

77
FROM alpine:latest
88
COPY --from=builder /usr/src/rumqtt/target/release/rumqttd /usr/local/bin/rumqttd
9-
COPY ./rumqttd/rumqttd.toml .
109
ENV RUST_LOG="info"
1110
ENTRYPOINT ["rumqttd"]

‎README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -48,14 +48,14 @@ rumqttd can be used with docker by pulling the image from docker hub as follows:
4848
docker pull bytebeamio/rumqttd
4949
```
5050

51-
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:
51+
To run rumqttd docker image you can simply run:
5252
```bash
53-
docker run -p 1883:1883 -p 1884:1884 -it bytebeamio/rumqttd -c rumqttd.toml
53+
docker run -p 1883:1883 -p 1884:1884 -it bytebeamio/rumqttd
5454
```
5555

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

6161
<br/>

‎rumqttd/README.md

+10-2
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,18 @@ Example config file is provided on the root of the repo.
2020

2121
#### Building the docker image
2222

23-
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):
23+
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:
24+
25+
```bash
26+
./build_rumqttd_docker.sh
27+
docker run -p 1883:1883 -p 1884:1884 -it rumqttd
28+
```
29+
30+
Or you can run `rumqttd` with the custom config file by mounting the file and passing it as argument:
31+
2432
```bash
2533
./build_rumqttd_docker.sh
26-
docker run -p 1883:1883 -p 1884:1884 -it rumqttd -c rumqttd.toml
34+
docker run -p 1883:1883 -p 1884:1884 -v /absolute/path/to/rumqttd.toml:/rumqttd.toml -it rumqttd -c /rumqttd.toml
2735
```
2836

2937
# How to use with TLS

0 commit comments

Comments
 (0)
Please sign in to comment.