# Use Docker to Compile Linux for ESP32-S3

## Overview

https://www.youtube.com/live/f6ZhVPpiNzM?

Have you ever wanted to run Linux on a microcontroller like the ESP32-S3? GitHub user [jcmvbkbc](https://github.com/jcmvbkbc) has a [Linux for ESP32-S3 script](https://gist.github.com/jcmvbkbc/316e6da728021c8ff670a24e674a35e6) that lets you do just that! However, compiling it can be tricky depending on your operating system with all of the toolchain dependencies. Don't worry though because there is a way around all of that: [a Docker container](https://www.hanselman.com/blog/docker-101-and-how-do-containers-work)! A container is a lightweight and fast virtual computer. The best part is it's easy for people to run no matter what operating system they are on. It's also much simpler and smaller than VirtualBox because it has only the bare essentials.

In this guide, you'll setup and install Docker, run a test Dockerfile to create a test container, run the ESP32-S3 Linux Dockerfile, upload the compiled files to the ESP32-S3 and then perform the ultimate skateboard trick: boot Linux on an ESP32-S3!

This version of Linux is barebones, the file system is utilizing [cramfs](https://en.wikipedia.org/wiki/Cramfs), so don't expect it to be like booting up a Raspberry Pi with Raspberry Pi OS. You'll access it over serial and you'll only be able to do super basic things but you'll learn a ton along the way.

## Parts
### Adafruit Metro ESP32-S3 with 16 MB Flash 8 MB PSRAM

[Adafruit Metro ESP32-S3 with 16 MB Flash 8 MB PSRAM](https://www.adafruit.com/product/5500)
What's Metro-shaped and has an ESP32-S3&nbsp;WiFi module? What has a STEMMA QT connector for I2C devices and a Lipoly charger circuit? What has your favorite Espressif WiFi microcontroller and lots of memory for your next IoT project?

That's right - it's the new...

In Stock
[Buy Now](https://www.adafruit.com/product/5500)
[Related Guides to the Product](https://learn.adafruit.com/products/5500/guides)
![Angled shot of black, credit-card-sized dev board.](https://cdn-shop.adafruit.com/640x480/5500-10.jpg)

### USB to TTL Serial Cable - Debug / Console Cable for Raspberry Pi

[USB to TTL Serial Cable - Debug / Console Cable for Raspberry Pi](https://www.adafruit.com/product/954)
The cable is easiest way ever to connect to your microcontroller/Raspberry Pi/WiFi router serial console port. Inside the big USB plug is a USB\<-\>Serial conversion chip and at the end of the 36" cable are four wire - red power, black ground, white RX into USB port, and green TX out...

In Stock
[Buy Now](https://www.adafruit.com/product/954)
[Related Guides to the Product](https://learn.adafruit.com/products/954/guides)
![USB to TTL Serial Cable With Type A plug and 4 wire sockets](https://cdn-shop.adafruit.com/640x480/954-02.jpg)

### Break-away 0.1" 36-pin strip male header - Black - 10 pack

[Break-away 0.1" 36-pin strip male header - Black - 10 pack](https://www.adafruit.com/product/392)
Breakaway header is like the duct tape of electronics. It's great for connecting things together, soldering to perf-boards, fits into any breakout or breadboard, etc. We go through these guys real fast, and thought that given how handy they are, we'd offer them in a pack of ten!<br...></br...>

Out of Stock
[Buy Now](https://www.adafruit.com/product/392)
[Related Guides to the Product](https://learn.adafruit.com/products/392/guides)
![10 pieces of Break-away 0.1 inch 36-pin strip male header](https://cdn-shop.adafruit.com/640x480/392-01.jpg)

### USB Type A to Type C Cable - approx 1 meter / 3 ft long

[USB Type A to Type C Cable - approx 1 meter / 3 ft long](https://www.adafruit.com/product/4474)
As technology changes and adapts, so does Adafruit. This&nbsp;&nbsp; **USB Type A to Type C** cable will help you with the transition to USB C, even if you're still totin' around a USB Type A hub, computer or laptop.

USB C is the latest industry-standard connector for...

In Stock
[Buy Now](https://www.adafruit.com/product/4474)
[Related Guides to the Product](https://learn.adafruit.com/products/4474/guides)
![Angled shot of a coiled black, USB-C to USB-A cable.](https://cdn-shop.adafruit.com/640x480/4474-02.jpg)

# Use Docker to Compile Linux for ESP32-S3

## Install Docker

Go to the [Docker website](https://www.docker.com/) and download the Docker version for your operating system. Then, launch the installer file that downloads.

![hacks_0_install_docker.png](https://cdn-learn.adafruit.com/assets/assets/000/123/591/medium640/hacks_0_install_docker.png?1692288600)

After installation finishes, you may be prompted to logout of your system to finish setting things up.

![hacks_2_logout.png](https://cdn-learn.adafruit.com/assets/assets/000/123/600/medium640/hacks_2_logout.png?1692288749)

When Docker launches for the first time, you'll be prompted with a service agreement. Click **Accept**.

![hacks_3_service_agreement.png](https://cdn-learn.adafruit.com/assets/assets/000/123/604/medium640/hacks_3_service_agreement.png?1692288805)

Then you'll be prompted to sign up for a Docker account. Click the **Sign Up** button to create an account.

![hacks_4_sign_in.png](https://cdn-learn.adafruit.com/assets/assets/000/123/608/medium640/hacks_4_sign_in.png?1692288846)

After creating an account on the Docker website, you'll be prompted to login for the first time. After logging in, you'll need to select a plan. There is a free plan for Docker ( **Personal** ) and everything covered in this guide works with the free tier.

![hacks__2_plans.png](https://cdn-learn.adafruit.com/assets/assets/000/123/617/medium640/hacks__2_plans.png?1692289004)

Then you can log into the Docker desktop application, where you can access your containers and images.

Next, you'll create a test Docker image to get used to how Docker works and check your workflow.

![hacks_5_docker_desktop.png](https://cdn-learn.adafruit.com/assets/assets/000/123/620/medium640/hacks_5_docker_desktop.png?1692289137)

# Use Docker to Compile Linux for ESP32-S3

## Docker Test Image

Before you go diving into compiling the Linux kernel, you can run this quick test Docker image to get familiar with Docker.

First, you're going to create a Dockerfile file. These files are run to create the Docker images and they use their own syntax. Copy and paste the following text into your preferred text editor:

![hacks___0_dockerfile.png](https://cdn-learn.adafruit.com/assets/assets/000/123/627/medium640/hacks___0_dockerfile.png?1692289675)

```auto
FROM ubuntu:22.04

RUN apt-get update

ENTRYPOINT ["tail", "-f", "/dev/null"]
```

Then, save the file as **Dockerfile** with no file extension. The Dockerfile you just created builds an Ubuntu 22.04 system. Then, it runs `apt-get update` and opens a terminal window for you to interact with the system. If you were to leave out the `ENTRYPOINT` line, the image would simply run `apt-get update` and then close down.

Next, open up a terminal and navigate to the folder where you just saved your Dockerfile. Run the following command to build the image:

`docker build -t docker_test .`

This tells docker to build the Dockerfile as an image and tag it (name it) as **docker\_test**.

![hacks___1_power_shell.png](https://cdn-learn.adafruit.com/assets/assets/000/123/628/medium640/hacks___1_power_shell.png?1692289824)

After running the command, you'll see Docker go through a series of build steps and then finish.

![hacks___2_run_command.png](https://cdn-learn.adafruit.com/assets/assets/000/123/629/medium640/hacks___2_run_command.png?1692290032)

Go to your Docker desktop application and click on the **Images** tab. You should see your **docker\_test** image that you just built.

![hacks___3_docker_test_in_docker.png](https://cdn-learn.adafruit.com/assets/assets/000/123/630/medium640/hacks___3_docker_test_in_docker.png?1692290076)

The image is static, similar to creating a USB drive with installation media if you've ever done a fresh install of Windows or Linux on hardware. To deploy the image that you just built, click on the **Play** button next to the image name. A dialog box will open and you'll click **Run**.

![hacks___4_run_in_docker.png](https://cdn-learn.adafruit.com/assets/assets/000/123/631/medium640/hacks___4_run_in_docker.png?1692290124)

This launches your image into a container. The container is where your virtual computer lives and runs. It is given the name of an adjective along with the name of a scientist as a nickname by default.&nbsp;

If you click on the **Terminal** tab in the container, you can interact with your new Ubuntu image.&nbsp;

![hacks___5_live_terminal_in_docker.png](https://cdn-learn.adafruit.com/assets/assets/000/123/632/medium640/hacks___5_live_terminal_in_docker.png?1692290323)

On the main Containers page, you can start or stop your container from running by clicking the **Play** or **Stop** buttons on the right-hand side of the window.

![hacks_start_stop_container.png](https://cdn-learn.adafruit.com/assets/assets/000/123/634/medium640/hacks_start_stop_container.png?1692290699)

Now that you've created your first Dockerfile, image and container, you can try using Docker to compile Linux for the ESP32-S3.

# Use Docker to Compile Linux for ESP32-S3

## Docker ESP32-S3 Linux Image

To begin, you'll save the Dockerfile below to a folder on your local filesystem. Name it as **Dockerfile** with no file extension, just like you did on the [Test Image page](https://learn.adafruit.com/docker-esp32-s3-linux/docker-test-image).

https://github.com/adafruit/Adafruit_Learning_System_Guides/blob/main/ESP32S3_Linux/Dockerfile

As you can see, this Dockerfile is a lot more detailed than the test image that you just ran. It installs all of the toolchains and dependencies on an Ubuntu build and then runs the script to compile the files needed to load onto the ESP32-S3.

![hacks_esp0_dockerfile.png](https://cdn-learn.adafruit.com/assets/assets/000/123/635/medium640/hacks_esp0_dockerfile.png?1692296982)

The steps for building are the same though. Open a terminal window, navigate to the folder where you saved the Dockerfile and enter:

`docker build -t esp32-s3_linux .`

This builds the image and names it **esp32-s3\_linux**.

![hacks_esp1_build_finished.png](https://cdn-learn.adafruit.com/assets/assets/000/123/636/medium640/hacks_esp1_build_finished.png?1692297058)

After building, go to the Docker desktop app and look under **Images**. Select your newly created **esp32-s3\_linux** image and click the **Play** button. Then click **Run** to start a container with the image.

![hacks_esp2_run_image.png](https://cdn-learn.adafruit.com/assets/assets/000/123/637/medium640/hacks_esp2_run_image.png?1692297148)

Once the container opens, go to the **Terminal** tab. You'll be able to interact with the Ubuntu machine that has your compiled files for the ESP32-S3.

![hacks_esp3_in_app_folder.png](https://cdn-learn.adafruit.com/assets/assets/000/123/638/medium640/hacks_esp3_in_app_folder.png?1692297230)

If you change directories to the releases folder (`cd /app/build/releases`) you'll see the kernel, file system and binary files that will be loaded onto your ESP32-S3. To use these files, you'll need to copy them to your local filesystem out of the Docker container.

![hacks_esp5_bin_files_in_folder.png](https://cdn-learn.adafruit.com/assets/assets/000/123/639/medium640/hacks_esp5_bin_files_in_folder.png?1692297287)

To do this, go back to a terminal window on your local desktop and navigate to the directory where you saved the Dockerfile. Enter the following command:

`docker cp CONTAINER-NAME:/app/build/release/ bin_files`

Replace `CONTAINER-NAME` with the name of your container in the Docker app. This copies the **/release** folder from your container in Docker to a folder called / **bin\_files**.

![hacks_esp6_copy_bin_files.png](https://cdn-learn.adafruit.com/assets/assets/000/123/640/medium640/hacks_esp6_copy_bin_files.png?1692297420)

Open the file location on your computer. You should see the five files now stored locally in the folder. This will allow you to use esptool and the ESP-IDF to load the files onto your ESP32-S3.

![hacks_esp7_bin_files_in_directory.png](https://cdn-learn.adafruit.com/assets/assets/000/123/641/medium640/hacks_esp7_bin_files_in_directory.png?1692297618)

# Use Docker to Compile Linux for ESP32-S3

## Upload the Files to the ESP32-S3

You will need two utilities from Espressif installed on your computer in order to upload the compiled files onto the ESP32-S3: esptool and the ESP-IDF.

## esptool

You'll use esptool to upload the binary files to the ESP32-S3. esptool is installed with `pip`. Open a terminal window and enter:

`pip install esptool`

For more information on esptool, you can check out the [documentation from Espressif](https://docs.espressif.com/projects/esptool/en/latest/esp32/installation.html).

[Espressif Documentation for esptool](https://docs.espressif.com/projects/esptool/en/latest/esp32/installation.html)
## ESP-IDF

The kernel and filesystem are written to the ESP32-S3 using parttool.py, which is a tool included in the ESP-IDF. You can install the ESP-IDF as a part of your IDE or separately on your local computer. [Espressif has documentation and installers](https://docs.espressif.com/projects/esp-idf/en/latest/esp32/get-started/#installation) on their site.&nbsp;

[ESP-IDF Installers and Installation Documentation](https://docs.espressif.com/projects/esp-idf/en/latest/esp32/get-started/#installation)
## Prep the Metro ESP32-S3

Now you finally get to play with hardware. You'll use the Metro ESP32-S3, which has 16 MB of Flash and 8 MB of PSRAM making it perfect for this skateboard trick.

You'll want to upload the files that you just built over hardware UART. The RX and TX hardware UART pins are accessible next to the ESP32-S3 module on the board. Solder two headers to those pins.

![hacks_5500-04.jpg](https://cdn-learn.adafruit.com/assets/assets/000/123/643/medium640/hacks_5500-04.jpg?1692298486)

### Break-away 0.1" 36-pin strip male header - Black - 10 pack

[Break-away 0.1" 36-pin strip male header - Black - 10 pack](https://www.adafruit.com/product/392)
Breakaway header is like the duct tape of electronics. It's great for connecting things together, soldering to perf-boards, fits into any breakout or breadboard, etc. We go through these guys real fast, and thought that given how handy they are, we'd offer them in a pack of ten!<br...></br...>

Out of Stock
[Buy Now](https://www.adafruit.com/product/392)
[Related Guides to the Product](https://learn.adafruit.com/products/392/guides)
![10 pieces of Break-away 0.1 inch 36-pin strip male header](https://cdn-shop.adafruit.com/640x480/392-01.jpg)

### USB to TTL Serial Cable - Debug / Console Cable for Raspberry Pi

[USB to TTL Serial Cable - Debug / Console Cable for Raspberry Pi](https://www.adafruit.com/product/954)
The cable is easiest way ever to connect to your microcontroller/Raspberry Pi/WiFi router serial console port. Inside the big USB plug is a USB\<-\>Serial conversion chip and at the end of the 36" cable are four wire - red power, black ground, white RX into USB port, and green TX out...

In Stock
[Buy Now](https://www.adafruit.com/product/954)
[Related Guides to the Product](https://learn.adafruit.com/products/954/guides)
![USB to TTL Serial Cable With Type A plug and 4 wire sockets](https://cdn-shop.adafruit.com/640x480/954-02.jpg)

Attach a USB to serial cable to the Metro ESP32-S3. You should see the board power up once you plug in the USB cable.

- **USB RX** to **ESP32-S3 TX (white wire)**
- **USB TX** to **ESP32-S3 RX (green wire)**
- **USB power** to **ESP32-S3 VIN (red wire)**
- **USB ground** to **ESP32-S3 GND (black wire)**

![hacks_esp32-s3_serialFritz_bb.jpg](https://cdn-learn.adafruit.com/assets/assets/000/123/644/medium640/hacks_esp32-s3_serialFritz_bb.jpg?1692298960)

## Binary Files

First, you'll upload the three binary files ( **bootloader.bin** , **network\_adapter.bin** and **partition-table.bin** ) to the ESP32-S3 with esptool.

Put the Metro ESP32-S3 into bootloader mode by holding down the boot button, pressing the reset button and then releasing the boot button. Then, open a terminal window and navigate to the directory where you saved the exported files from the Docker container. Enter this command to upload the three files to the ESP32-S3:

```terminal
python esptool.py --chip esp32s3 -p YOUR-PORT-HERE -b 921600 --before=default_reset --after=hard_reset write_flash 0x0 bootloader.bin 0x10000 network_adapter.bin 0x8000 partition-table.bin
```

Replace `YOUR-PORT-HERE` with the USB port number that the ESP32-S3 is attached to. On Linux or Mac it may look like `/dev/ttyUSB0`. On Windows, it will be COM followed by a number. For example, `COM3`.

## File System and Kernel

Next, you'll use the ESP-IDF terminal to upload the file system and kernel file. Open an ESP-IDF terminal window and navigate to the directory where you saved the exported files from the Docker container. First, put the Metro ESP32-S3 into bootloader mode by holding down the boot button, pressing the reset button and then releasing the boot button. Then upload the kernel file ( **xipImage** ) first with:

```terminal
parttool.py write_partition --partition-name linux --input xipImage
```

Put the Metro ESP32-S3 into bootloader mode again and then upload the file system file ( **rootfs.cramfs** ) with:

```terminal
parttool.py write_partition --partition-name rootfs --input rootfs.cramfs
```

Next you'll boot into Linux on an ESP32-S3!

# Use Docker to Compile Linux for ESP32-S3

## Boot Linux on the ESP32-S3

You'll be able to log into Linux on the ESP32-S3 by using a serial connection.

Using your preferred serial client, open a serial connection with the hardware UART port on the ESP32-S3 at a 115200 baudrate.

![hacks_putty.png](https://cdn-learn.adafruit.com/assets/assets/000/123/645/medium640/hacks_putty.png?1692300397)

Press the reset button on the ESP32-S3. In your serial monitor, you should see Linux booting up. When its ready, it will prompt you for a login. Enter `root`. This will bring you to the filesystem.

![hacks_terminal.png](https://cdn-learn.adafruit.com/assets/assets/000/123/646/medium640/hacks_terminal.png?1692300463)

You may see spurious `FW_MAIN` print statements randomly pop up in your serial monitor. This is the WiFi core printing status messages and is normal for this build.

## WiFi

To connect to WiFi, enter the following commands:

```terminal
ip link set espsta0 up
cat > /tmp/wpa_supplicant.conf <<EOF
network={
        ssid="YOUR-SSID-HERE"
        psk="YOUR-SSID-PASSWORD-HERE"
}
EOF
wpa_supplicant -B -i espsta0 -c /tmp/wpa_supplicant.conf &
udhcpc -i espsta0
```

Replace `YOUR-SSID-HERE` and `YOUR-SSID-PASSWORD-HERE` with your network SSID and SSID password. This creates a `wpa_supplicant` configuration file in the **/tmp** folder that will let you connect to a secured network.

You can test your network connection by pinging a URL with:

`ping google.com`

Press Control + C to stop pinging the URL. You should see packets transmitted.

![hacks_google_ping.png](https://cdn-learn.adafruit.com/assets/assets/000/123/647/medium640/hacks_google_ping.png?1692300818)

## Customize

Otherwise there isn't a lot more that you can do with this Linux installation. The following page will show you how to run the [Buildroot menuconfig](https://buildroot.org/downloads/manual/manual.html) in the Docker container to customize the image and recompile it.

# Use Docker to Compile Linux for ESP32-S3

## Customize with menuconfig

You've booted Linux on an ESP32-S3 and now you want to add some customization. You can do that with the menuconfig tool in **/buildroot**. This lets you select options to include in your kernel and filesystem. After running menuconfig, you'll rebuild the files and upload them to the ESP32-S3 partition tables so that you can boot into your new Linux image.

First you'll clean up the previously compiled files by running `make clean` in the **/buildroot** directory.

```terminal
cd /app/build/buildroot
make clean
```

Next, you'll run some commands to rebuild the filesystem and kernel. You're essentially re-running commands manually that are performed in the Dockerfile. First, you'll go up one level in the directory with:

```terminal
cd ..
```

Then you'll `clean` the previous compilation run with:

```terminal
make -C buildroot O=`pwd`/build-xtensa-2023.02-fdpic-esp32s3 clean
```

Run the following commands to prep the **.config** file. This file contains all of the build settings.

```terminal
make -C buildroot O=`pwd`/build-xtensa-2023.02-fdpic-esp32s3 esp32s3wifi_defconfig

buildroot/utils/config --file build-xtensa-2023.02-fdpic-esp32s3/.config --set-str TOOLCHAIN_EXTERNAL_PATH `pwd`/crosstool-NG/builds/xtensa-esp32s3-linux-uclibcfdpic

buildroot/utils/config --file build-xtensa-2023.02-fdpic-esp32s3/.config --set-str TOOLCHAIN_EXTERNAL_PREFIX '$(ARCH)-esp32s3-linux-uclibcfdpic'

buildroot/utils/config --file build-xtensa-2023.02-fdpic-esp32s3/.config --set-str TOOLCHAIN_EXTERNAL_CUSTOM_PREFIX '$(ARCH)-esp32s3-linux-uclibcfdpic'
```

Then you'll enter the `menuconfig` tool with:

```terminal
make -C buildroot O=`pwd`/build-xtensa-2023.02-fdpic-esp32s3 menuconfig
```

This opens a GUI tool that you can navigate with the arrow keys on your keyboard.

![](https://cdn-learn.adafruit.com/assets/assets/000/123/649/medium800/hacks_main_gui.png?1692377775)

Start by going to **Target options** and making sure that the image is being built for the correct target.

- Target Architecture: **Xtensa**
- Target Architecture Variant: **Dynamic Xtensa processor configuration**
- Target Architecture Endianness: **Little endian**
- ( **\*** ) MMU support
- Target Binary Format: **ELF**

![hacks_target_config.png](https://cdn-learn.adafruit.com/assets/assets/000/123/659/medium640/hacks_target_config.png?1692378978)

Navigate to the **System configuration** menu. On this page, you'll edit the **hostname** and **welcome banner**.

![hacks_default_sys_config.png](https://cdn-learn.adafruit.com/assets/assets/000/123/650/medium640/hacks_default_sys_config.png?1692377834)

Select **System hostname** and enter the hostname that you would like for your system to have. Highlight **OK** and hit **enter** to confirm.

![hacks_sys_hostname.png](https://cdn-learn.adafruit.com/assets/assets/000/123/652/medium640/hacks_sys_hostname.png?1692377902)

Select the System banner and enter the custom welcome message you'd like to see when you log into the system. Highlight **OK** and hit **enter** to confirm.

![hacks_system_banner.png](https://cdn-learn.adafruit.com/assets/assets/000/123/653/medium640/hacks_system_banner.png?1692377966)

Select **Save** on the main GUI. This will open a dialog box showing that you are saving to the **.config** file. Select **OK** to confirm.

![hacks_save_config.png](https://cdn-learn.adafruit.com/assets/assets/000/123/664/medium640/hacks_save_config.png?1692408510)

Now you'll use `make` to compile all of the build settings and build the filesystem and kernel files.

```terminal
make -C buildroot O=`pwd`/build-xtensa-2023.02-fdpic-esp32s3

[ -f build/build-xtensa-2023.02-fdpic-esp32s3/images/xipImage -a -f build/build-xtensa-2023.02-fdpic-esp32s3/images/rootfs.cramfs ] || exit 1
```

You'll move the files to the / **release** folder with:

```terminal
cd build

cp build-xtensa-2023.02-fdpic-esp32s3/images/xipImage release
cp build-xtensa-2023.02-fdpic-esp32s3/images/rootfs.cramfs release
```

You'll move the files from Docker to your local filesystem by opening a terminal on your local system, navigating to the directory where you want the files to be and entering:

```terminal
docker cp YOUR-CONTAINER-NAME-HERE:/app/build/release bin_files
```

This is the same step that you did earlier with the unmodified files. Next, you'll flash the **xipImage** and **rootfs.cramfs** files using **parttool.py** in the ESP-IDF as described on the [Upload Files page](https://learn.adafruit.com/docker-esp32-s3-linux/upload-the-files-to-the-esp32-s3).

## Boot into Linux
![](https://cdn-learn.adafruit.com/assets/assets/000/123/658/medium800/hacks_host_and_welcome.png?1692378820)

Log into the ESP32-S3 over serial to see your Linux system in action. If all went well, you should be greeted with your custom welcome message and hostname.

# Use Docker to Compile Linux for ESP32-S3

## Customize with ESP-IDF menuconfig

On the previous page you customized the kernel and filesystem with buildroot's menuconfig tool. The [ESP-IDF has a similar menuconfig](https://docs.espressif.com/projects/esp-idf/en/latest/esp32s3/api-reference/kconfig.html) that lets you adjust parameters for the targeted ESP chip, such as flash size and partition table. Just like how you recompiled the file system and kernel, you can recompile the bootloader, partition table and network adapter .bin files using the following steps.

## Partition Table

The partition table in an ESP-IDF project determines the file structure on the ESP32 chip. In the Docker container, the partition table file is located in **/app/build/esp-hosted/esp\_hosted\_ng/esp\_driver/network\_adapter/partition\_table.esp32s3**

The default partition table is setup as follows:

You can edit the partition table directly in the Docker container by going to the **Files** tab and navigating to the file location. **Right-click** on the partition table file and you can edit it in the text editor that opens at the bottom of the screen.

![hacks_partition_table.png](https://cdn-learn.adafruit.com/assets/assets/000/123/885/medium640/hacks_partition_table.png?1692815554)

The changes to the partition table only take effect after recompiling the ESP-IDF project. These steps are outlined next.

## ESP-IDF menuconfig

To recompile the ESP-IDF generated .bin files, you'll run the ESP-IDF steps from the Dockerfile. In the **Terminal tab** in your Docker container, run these commands:

```terminal
cd esp-hosted/esp_hosted_ng/esp/esp_driver && cmake .
cd esp-idf && . ./export.sh
cd ../network_adapter && idf.py set-target esp32s3
cp sdkconfig.defaults.esp32s3 sdkconfig
```

Then enter the **menuconfig tool** with:

```terminal
idf.py menuconfig
```

![](https://cdn-learn.adafruit.com/assets/assets/000/123/886/medium800/hacks_main_menu.png?1692816049)

You can change the flash size to match your target board by navigating to **Serial flasher config - flash size.&nbsp;** There you can select the flash size on your board. In the case of the Metro ESP32-S3, its **16MB**.

![hacks_flash_size.png](https://cdn-learn.adafruit.com/assets/assets/000/123/887/medium640/hacks_flash_size.png?1692816098)

You can also change or confirm your partition table by navigating to the **Partition Table** page.

![hacks_partition_table_16m.png](https://cdn-learn.adafruit.com/assets/assets/000/123/888/medium640/hacks_partition_table_16m.png?1692816144)

When you're finished, save your configuration as **sdkconfig** (the default option) and then **exit menuconfig**.

![hacks_save.png](https://cdn-learn.adafruit.com/assets/assets/000/123/889/medium640/hacks_save.png?1692816179)

Next you'll build your project with:

```terminal
idf.py build
```

Finally you'll copy your generated **.bin** files to the **/releases** folder in the Docker container:

```terminal
cd /app/build

cp esp-hosted/esp_hosted_ng/esp/esp_driver/network_adapter/build/bootloader/bootloader.bin release
cp esp-hosted/esp_hosted_ng/esp/esp_driver/network_adapter/build/partition_table/partition-table.bin release
cp esp-hosted/esp_hosted_ng/esp/esp_driver/network_adapter/build/network_adapter.bin release
```

And copy the newly generated **.bin** files to your local filesystem, just as you did [earlier in the guide.](https://learn.adafruit.com/docker-esp32-s3-linux/docker-esp32-s3-linux-image#step-3152882)

```terminal
docker cp CONTAINER-NAME:/app/build/release/ bin_files
```

Now you can load your new **.bin** files onto your [ESP32-S3 using esptool.](https://learn.adafruit.com/docker-esp32-s3-linux/upload-the-files-to-the-esp32-s3)


## Featured Products

### Adafruit Metro ESP32-S3 with 16 MB Flash 8 MB PSRAM

[Adafruit Metro ESP32-S3 with 16 MB Flash 8 MB PSRAM](https://www.adafruit.com/product/5500)
What's Metro-shaped and has an ESP32-S3&nbsp;WiFi module? What has a STEMMA QT connector for I2C devices and a Lipoly charger circuit? What has your favorite Espressif WiFi microcontroller and lots of memory for your next IoT project?

That's right - it's the new...

In Stock
[Buy Now](https://www.adafruit.com/product/5500)
[Related Guides to the Product](https://learn.adafruit.com/products/5500/guides)
### USB to TTL Serial Cable - Debug / Console Cable for Raspberry Pi

[USB to TTL Serial Cable - Debug / Console Cable for Raspberry Pi](https://www.adafruit.com/product/954)
The cable is easiest way ever to connect to your microcontroller/Raspberry Pi/WiFi router serial console port. Inside the big USB plug is a USB\<-\>Serial conversion chip and at the end of the 36" cable are four wire - red power, black ground, white RX into USB port, and green TX out...

In Stock
[Buy Now](https://www.adafruit.com/product/954)
[Related Guides to the Product](https://learn.adafruit.com/products/954/guides)
### Break-away 0.1" 36-pin strip male header - Black - 10 pack

[Break-away 0.1" 36-pin strip male header - Black - 10 pack](https://www.adafruit.com/product/392)
Breakaway header is like the duct tape of electronics. It's great for connecting things together, soldering to perf-boards, fits into any breakout or breadboard, etc. We go through these guys real fast, and thought that given how handy they are, we'd offer them in a pack of ten!<br...></br...>

Out of Stock
[Buy Now](https://www.adafruit.com/product/392)
[Related Guides to the Product](https://learn.adafruit.com/products/392/guides)
### USB Type A to Type C Cable - approx 1 meter / 3 ft long

[USB Type A to Type C Cable - approx 1 meter / 3 ft long](https://www.adafruit.com/product/4474)
As technology changes and adapts, so does Adafruit. This&nbsp;&nbsp; **USB Type A to Type C** cable will help you with the transition to USB C, even if you're still totin' around a USB Type A hub, computer or laptop.

USB C is the latest industry-standard connector for...

In Stock
[Buy Now](https://www.adafruit.com/product/4474)
[Related Guides to the Product](https://learn.adafruit.com/products/4474/guides)

## Related Guides

- [Adafruit Metro ESP32-S3](https://learn.adafruit.com/adafruit-metro-esp32-s3.md)
- [ESP-NOW in CircuitPython](https://learn.adafruit.com/esp-now-in-circuitpython.md)
- [Networking in CircuitPython](https://learn.adafruit.com/networking-in-circuitpython.md)
- [Plotting Offline Data - JSONL to CSV files, filters and graphs](https://learn.adafruit.com/plotting-offline-data-jsonl-to-csv-files-filters-and-graphs.md)
- [MP3 Playback with CircuitPython](https://learn.adafruit.com/mp3-playback-with-circuitpython.md)
- [Gravatars: What they are and how to add or change one](https://learn.adafruit.com/gravatars-what-they-are-and-how-to-add-or-change-one.md)
- [LEGO Set Lighting](https://learn.adafruit.com/lego-set-lighting.md)
- [Neon LED Signs](https://learn.adafruit.com/led-neon-signs.md)
- [Computer Perfection Synthesizer](https://learn.adafruit.com/computer-perfection-synthesizer.md)
- [Sideloading Apps on Oculus Quest](https://learn.adafruit.com/sideloading-on-oculus-quest.md)
- [Contribute to CircuitPython with Git and GitHub](https://learn.adafruit.com/contribute-to-circuitpython-with-git-and-github.md)
- [Ladyada's Learn Arduino - Lesson #0](https://learn.adafruit.com/ladyadas-learn-arduino-lesson-number-0.md)
- [No-Code IKEA Vindriktning Air Quality Sensor Hack with Adafruit IO](https://learn.adafruit.com/no-code-ikea-vindriktning-hack-with-qt-py-esp32-s3-and-adafruit-io.md)
- [Cynaps Bone Conduction Headset Teardown](https://learn.adafruit.com/cynaps-bone-conduction-headset-teardown.md)
- [Digital Circuits 6: An EPROM Emulator](https://learn.adafruit.com/digital-circuits-6-eprom-emulator.md)
