Skip to content

Commit

Permalink
Merge pull request #10 from Dpbm/compose
Browse files Browse the repository at this point in the history
Compose
  • Loading branch information
Dpbm authored Nov 23, 2023
2 parents 47d999a + c94401b commit bde58d7
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 0 deletions.
11 changes: 11 additions & 0 deletions default-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
services:
metal:
build:
context: ./
dockerfile: ubuntu.Dockerfile
volumes:
- /tmp/.X11-unix:/tmp/.X11-unix:ro
environment:
DISPLAY: $DISPLAY
ports:
- 8888:8888
21 changes: 21 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ These are pretty the same thing, just with more dependencies or default tooling
To use these images you must have installed on your host machine:

- [Docker](https://www.docker.com/)
- [Docker compose](https://docs.docker.com/compose/) (optional)
- [xServer](https://www.x.org/wiki/) (for metal GUI)

Also set your the [`DISPLAY`](https://www.x.org/archive/X11R6.8.0/doc/X.7.html) environment variable, in case it wasn't configured before.
Expand Down Expand Up @@ -64,6 +65,26 @@ docker run -d -v /tmp/.X11-unix:/tmp/.X11-unix:ro -e DISPLAY=$DISPLAY ghcr.io/dp
docker run -d ghcr.io/dpbm/qiskit-metal-docker:[tag]
```

If you want a simpler way to run it, you can use the docker compose. There're two files for that:

- [default-compose.yaml](./default-compose.yaml)
- [template-compose.yaml](./template-compose.yaml)

The [default-compose.yaml](./default-compose.yaml) has the default configuration to run the image based on `Ubuntu`, and the second one is a template for those who want to add your own settings.

This last one can be renamed for `<whatever_you_want>.yaml`.

To start the image using docker compose, run:

```bash
docker compose --project-directory ./ -f default-compose.yaml up -d

#or

docker compose --project-directory ./ -f <whatever>.yaml up -d
```


Then, access `http://<docker_ip>:8888` on your browser. If you don't know the `docker ip` run:

```bash
Expand Down
13 changes: 13 additions & 0 deletions template-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
services:
metal:
build:
context: ./
#insert here the desired image
dockerfile: # e.g. ubuntu.Dockerfile
volumes:
- # map your .X11-unix file here like: /tmp/.X11-unix:/tmp/.X11-unix:ro
- # if you want to add a new volume to save files, just add here
environment:
DISPLAY: $DISPLAY
ports:
- 8888:8888

0 comments on commit bde58d7

Please sign in to comment.