Update README.md

This commit is contained in:
Matteo Carnelos 2021-09-04 19:22:58 +02:00 committed by GitHub
parent ca71ed7a8b
commit a67bc86987
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -66,10 +66,10 @@ docker run -it lukechilds/dockerpi pi3
In some applications you may want to have access to some ports of the Raspberry Pi (e.g. for SSH connection). To do so, you can set the `QEMU_HOSTFWD` enviroment variable of the container by adding one or more entries, separated by spaces, in the standard QEMU format (`protocol::hostip:hostport-guestip:guestport`).
Example using the `docker run` command to expose the SSH port from the Raspberry Pi to the Container (`-e` part) and from the Container to the Host (`-p` part):
Example using the `docker run` command to expose the SSH and MQTT ports from the Raspberry Pi to the Container (`-e` part) and from the Container to the Host (`-p` part):
```
docker run -it -e QEMU_HOSTFWD=tcp::5022-:22 -p 5022:5022 lukechilds/dockerpi
docker run -it -e QEMU_HOSTFWD="tcp::5022-:22 tcp::1883-:1883" -p 5022:5022 -p 1883:1883 lukechilds/dockerpi
```
Example using the `docker-compose.yml` file to achieve the same result:
@ -79,9 +79,10 @@ services:
dockerpi:
image: lukechilds/dockerpi
environment:
- QEMU_HOSTFWD=tcp::5022-:22
- QEMU_HOSTFWD=tcp::5022-:22 tcp::1883-:1883
ports:
- "5022:5022"
- "1883:1883"
```
## Wait, what?