Skip to main content

Setting up with Docker on Windows / macOS

Get Source Code

git clone git@github.com:opencis/opencis-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 opencis-core, run:

note

Don't forget the dot ('.') at the end.

docker build -f docker/Dockerfile-dev -t opencis.io/opencis-core .

Container Setup

We will now create a container based on the Docker image we have built. The following diagram illustrates the intended setup.

Alt text

Start Container

Stay in the root directory of opencis-core and run:

macOS

docker run -d -v $PWD:/opencis-core --name opencis-core opencis.io/opencis-core

Windows

docker run -d -v "%cd%":/opencis-core --name opencis-core opencis.io/opencis-core

This starts a container named opencis-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 opencis-core is "Up" (e.g. "Up 25 seconds").

docker ps

Access opencis-core

docker exec -it opencis-core /bin/bash

You will be directed to /opencis-core. This is a mapped directory of the root directory of opencis-core on the host machine. Hence, the changes you make in the host machine's opencis-core directory will be automatically reflected on this directory in the container (and vice versa).

note
  • 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 opencis-core", it is /opencis-core in opencis-core container.

  • As of this writing, running QEMU with Docker on Windows / macOS is not yet supported.

Continue to Run Instructions