Setting up with Docker on Windows / macOS
Get Source Code
git clone git@github.com:opencxl/opencxl-core.git
Build Docker Image
We will now build a docker image for Python components. It will provide a dev/run environment that can be used in lieu of the native Ubuntu environment. In the following Run section, you will run the commands inside of this environment.
From the root directory of opencxl-core
, run:
Don't forget the dot ('.') at the end.
docker build -f docker/Dockerfile-dev -t opencxl.org/opencxl-core .
Container Setup
We will now create a container based on the Docker image we have built. The following diagram illustrates the intended setup.
Start Container
Stay in the root directory of opencxl-core
and run:
macOS
docker run -d -v $PWD:/opencxl-core --name opencxl-core opencxl.org/opencxl-core
Windows
docker run -d -v "%cd%":/opencxl-core --name opencxl-core opencxl.org/opencxl-core
This starts a container named opencxl-core which is for Python components.
Access Container
Similar to logging into a remote machine via SSH/telnet, one can get terminal access to a running container by:
docker exec -it <name of the container> /bin/bash
First, confirm that opencxl-core is "Up" (e.g. "Up 25 seconds").
docker ps
Access opencxl-core
docker exec -it opencxl-core /bin/bash
You will be directed to /opencxl-core
. This is a mapped directory of the root directory of
opencxl-core
on the host machine. Hence, the changes you make in the host machine's
opencxl-core
directory will be automatically reflected on this directory in the container
(and vice versa).
-
Once again, in the next section, you will be running the commands inside of this container. When the instruction directs you to "the root directory of
opencxl-core
", it is/opencxl-core
in opencxl-core container. -
As of this writing, running QEMU with Docker on Windows / macOS is not yet supported.
Continue to Run Instructions