Skip to content

Conversation

@ralight
Copy link
Contributor

@ralight ralight commented Oct 21, 2024

No description provided.

Copy link
Member

@tianon tianon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I left a few comments -- notably, $(pwd) shells out unnecessarily: the shell maintains $PWD automatically 😄


```console
$ docker run -it -p 1883:1883 -p 9001:9001 -v mosquitto.conf:/mosquitto/config/mosquitto.conf %%IMAGE%%
$ docker run -it -p 1883:1883 -v $(pwd)/mosquitto/config:/mosquitto/config %%IMAGE%%
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
$ docker run -it -p 1883:1883 -v $(pwd)/mosquitto/config:/mosquitto/config %%IMAGE%%
$ docker run -it -p 1883:1883 -v "$PWD/mosquitto/config:/mosquitto/config" %%IMAGE%%


```console
$ docker run -it -p 1883:1883 -p 9001:9001 -v mosquitto.conf:/mosquitto/config/mosquitto.conf -v /mosquitto/data -v /mosquitto/log %%IMAGE%%
$ docker run -it -p 1883:1883 -v $(pwd)/mosquitto/config:/mosquitto/config -v /mosquitto/data -v /mosquitto/log %%IMAGE%%
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
$ docker run -it -p 1883:1883 -v $(pwd)/mosquitto/config:/mosquitto/config -v /mosquitto/data -v /mosquitto/log %%IMAGE%%
$ docker run -it -p 1883:1883 -v "$PWD/mosquitto/config:/mosquitto/config" -v /mosquitto/data -v /mosquitto/log %%IMAGE%%

or:

```console
$ docker run -it -p 1883:1883 -v $(pwd)/mosquitto/config:/mosquitto/config -v $(pwd)/mosquitto/data:/mosquitto/data -v $(pwd)/mosquitto/log:/mosquitto/log %%IMAGE%%
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
$ docker run -it -p 1883:1883 -v $(pwd)/mosquitto/config:/mosquitto/config -v $(pwd)/mosquitto/data:/mosquitto/data -v $(pwd)/mosquitto/log:/mosquitto/log %%IMAGE%%
$ docker run -it -p 1883:1883 -v "$PWD/mosquitto/config:/mosquitto/config" -v "$PWD/mosquitto/data:/mosquitto/data" -v "$PWD/mosquitto/log:/mosquitto/log" %%IMAGE%%

## Configuration

When running the image, the default configuration values are used. To use a custom configuration file, mount a **local** configuration file to `/mosquitto/config/mosquitto.conf`
When running the image, the default configuration values are used. To use a custom configuration file, create your mosquitto.conf in `$(pwd)/mosquitto/config/mosquitto.conf`, then mount the config directory to `/mosquitto/config`.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
When running the image, the default configuration values are used. To use a custom configuration file, create your mosquitto.conf in `$(pwd)/mosquitto/config/mosquitto.conf`, then mount the config directory to `/mosquitto/config`.
When running the image, the default configuration values are used. To use a custom configuration file, create your mosquitto.conf in `$PWD/mosquitto/config/mosquitto.conf`, then mount the config directory to `/mosquitto/config`.

For example, if you use port 1883 and port 8080:

```console
$ docker run -it -p 1883:1883 -p 8080:8080 -v $(pwd)/mosquitto/config:/mosquitto/config %%IMAGE%%
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
$ docker run -it -p 1883:1883 -p 8080:8080 -v $(pwd)/mosquitto/config:/mosquitto/config %%IMAGE%%
$ docker run -it -p 1883:1883 -p 8080:8080 -v "$PWD/mosquitto/config:/mosquitto/config" %%IMAGE%%

@ralight ralight force-pushed the eclipse-mosquitto-docs branch from 5a9d4a2 to aa625c5 Compare October 22, 2024 17:02
@ralight ralight force-pushed the eclipse-mosquitto-docs branch from aa625c5 to 2bf3f35 Compare October 22, 2024 17:03
@ralight
Copy link
Contributor Author

ralight commented Oct 22, 2024

I left a few comments -- notably, $(pwd) shells out unnecessarily: the shell maintains $PWD automatically 😄

Thanks, that's bad habit of mine :)

@tianon tianon merged commit 9206594 into docker-library:master Oct 22, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants