Skip to content

Commit e6e004a

Browse files
committed
docs: 📝 Update Docker documentation
1 parent 3dd7026 commit e6e004a

File tree

1 file changed

+15
-18
lines changed

1 file changed

+15
-18
lines changed

book/src/02_2_software.md

Lines changed: 15 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -73,37 +73,34 @@ brew install llvm
7373
An alternative environment, is to use Docker. The repository contains a `Dockerfile`
7474
with instructions to install the Rust toolchain, and all required packages. **This virtualized environment is designed
7575
to compile the binaries for the Espressif target. Flashing binaries from containers is not possible**, hence there are two options:
76-
- Execute flashing commands, e.g., `cargo-espflash`, on the host system.
76+
- Execute flashing commands, e.g., `cargo-espflash`, on the host system. If proceeding with this option, it's recommended to keep two terminals open:
77+
- In the container: compile the project
78+
- On the host: use the `cargo-espflash` sub-command to flash the program onto the embedded hardware
7779
- Use [`web-flash`](https://github.com/esp-rs/esp-web-flash-server) crate to flash the resulting binaries from the container. The container already includes `web-flash`. Here is how you would flash the build output of [`hardware-check` project](./02_4_hello_board.md):
7880
```console
7981
web-flash --chip esp32c3 target/riscv32imc-esp-espidf/debug/hardware-check
8082
```
8183

8284
✅ Install [`Docker`](https://docs.docker.com/get-docker/) for your operating system.
8385

84-
To build the Docker image, run the following command from the root folder:
85-
86-
```console
87-
docker image build --tag esp --file .devcontainer/Dockerfile .
88-
```
89-
90-
Building the image takes a while depending on the OS & hardware (20-30 minutes).
91-
92-
To start the new Docker container run:
93-
86+
✅ Get the docker image: There are 2 ways of getting the Docker image:
87+
- Build the Docker image from the `Dockerfile`:
88+
```console
89+
docker image build --tag rust-std-training --file .devcontainer/Dockerfile .
90+
```
91+
Building the image takes a while depending on the OS & hardware (20-30 minutes).
92+
- Donwload it from [Dockerhub](https://hub.docker.com/r/espressif/rust-std-training):
93+
```console
94+
docker pull espressif/rust-std-training
95+
```
96+
✅ Start the new Docker container:
9497
```console
95-
docker run --mount type=bind,source="$(pwd)",target=/workspace,consistency=cached -it esp /bin/bash
98+
docker run --mount type=bind,source="$(pwd)",target=/workspace,consistency=cached -it rust-std-training /bin/bash
9699
```
97100

98101
This starts an interactive shell in the Docker container. It also mounts the local repository to a folder
99102
named `/workspace` inside the container. Changes to the project on the host system are reflected inside the container & vice versa.
100103

101-
Using this Docker setup requires certain commands to run inside the container, while others have to be executed on the host system.
102-
It's recommended to keep two terminals open, one connected to the Docker container, one on the host system.
103-
104-
* in the container: compile the project
105-
* on the host: use the `cargo-espflash` sub-command to flash the program onto the embedded hardware
106-
107104
## Additional Software
108105

109106
### VS Code

0 commit comments

Comments
 (0)