Before that, we need to prepare tools for integrating with Search. This time, we'll set up the Docker environment. Today, I'll cover the macOS setup, and tomorrow, I'll share notes on how I handle the Windows environment.
![](/_next/image?url=https%3A%2F%2Fimages.ctfassets.net%2Fzi1ovlormku8%2F5ETc8ZjHN9GjLen6LWhKLV%2Fab5540d0923d1283ea81d382fdc1c83e%2Ffejuz-q6j5mSRpi50-unsplash.jpg&w=3840&q=75)
Prerequisite
The machine we are working on this time is as follows
- MacBook Pro 14 ( 2021 )
- Apple M1 Max
- Memory 32GB
- macOS Sonoma 14.0
This machine is an M1, which means it is an ARM version of the MacBook. Therefore, it is not possible to use Windows containers, but it is possible to use Linux containers. In this article, we will introduce the procedure.
Install
As for installation, this time, simply install Docker Desktop.
Basically, this allows you to use Docker.
How to use Linux containers
Even if you install the Docker Desktop mentioned above, it will download the ARM version of the container and install tools for macOS. You can use the amd64 version of the Linux container by specifying the platform.
The platform is specified in the docker-compose.yml file as follows. First, let's create an image without specifying the platform. The container image is created as follows.
![dockermacos01.png](/_next/image?url=https%3A%2F%2Fimages.ctfassets.net%2Fzi1ovlormku8%2F3CevAdahSisYofvu2yKfH8%2F603382a3812a23d2a9fe3d02be303515%2Fdockermacos01.png&w=3840&q=75)
Then, specify linux/amd64 for platform.
services:
playwright:
image: ${COMPOSE_PROJECT_NAME}-playwright:${PROJECT_VERSION}
platform: linux/amd64
build: context: ./src/playwright
The actual build of the image is as follows.
![dockermacos02.png](/_next/image?url=https%3A%2F%2Fimages.ctfassets.net%2Fzi1ovlormku8%2F4zeieXmANg6IOnAqp5FwZm%2F3e48c15bddc1202ea6165dc031f1354d%2Fdockermacos02.png&w=3840&q=75)
Now you can build a Linux container. However, a few more steps are required. However, a few more steps are required, since Linux containers are not compatible with ARM-based macOS, such as M1. This can be resolved by using the Docker Desktop settings: open the Features in Develpoment screen and you will see the following checkboxes
![dockermacos03.png](/_next/image?url=https%3A%2F%2Fimages.ctfassets.net%2Fzi1ovlormku8%2F4vj58rSA6SHRBVJhGC0qhX%2F514ec50e4891b3c5d10b65f6d77d894a%2Fdockermacos03.png&w=3840&q=75)
Rosetta should be checked in Apple Silicon to work. If this is not checked, please make sure that Use Virtualization framework in General is checked.
Summary
When using Docker on a MacBook with a different CPU architecture, there is a container for ARM, which is not so inconvenient for use on hand, but the above configuration allows you to use images for deployment in the cloud on hand.