diff --git a/Dockerfile b/Dockerfile index 65c9c5ba4..1aa515900 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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"] diff --git a/README.md b/README.md index f51fae7b8..7eca8805f 100644 --- a/README.md +++ b/README.md @@ -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 ```
diff --git a/rumqttd/README.md b/rumqttd/README.md index 3c9cd6652..93c6f7e90 100644 --- a/rumqttd/README.md +++ b/rumqttd/README.md @@ -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