Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix devcontainer setup on non-rootless docker #3

Open
wants to merge 4 commits into
base: switch-to-poetry
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion .devcontainer.json
Expand Up @@ -19,5 +19,6 @@
"EditorConfig.EditorConfig",
"paulvarache.vscode-taskfile",
"stardog-union.vscode-stardog-languages"
]
],
"postCreateCommand": "poetry install --all-extras"
}
20 changes: 15 additions & 5 deletions docker-compose.yml
Expand Up @@ -10,17 +10,27 @@ services:
- POETRY_VIRTUALENVS_IN_PROJECT=1
volumes:
- .:/srv/workspace:z,cached
- xdg-cache-home:/root/.cache
- dot-venv:/srv/workspace/.venv
- dot-tox:/srv/workspace/.tox
- dot-mypy-cache:/srv/workspace/.mypy_cache
- dot-pytest-cache:/srv/workspace/.pytest_cache
command:
- /bin/sh
- -c
- |
echo Waiting for shutdown... override the command if this is not what you want. 1>&2
while sleep 1000; do :; done

run:
build:
context: .
dockerfile: Dockerfile.devcontainer
working_dir: /srv/workspace
environment:
- POETRY_VIRTUALENVS_IN_PROJECT=1
volumes:
- .:/srv/workspace:z,cached
- xdg-cache-home:/root/.cache
- dot-venv:/srv/workspace/.venv
- dot-tox:/srv/workspace/.tox
- dot-mypy-cache:/srv/workspace/.mypy_cache
- dot-pytest-cache:/srv/workspace/.pytest_cache
volumes:
xdg-cache-home: {}
dot-venv: {}
Expand Down
8 changes: 4 additions & 4 deletions docs/developers.rst
Expand Up @@ -297,16 +297,16 @@ To use the development container directly:
docker-compose build

# Configure the system for development.
docker-compose run --rm devcontainer task configure
docker-compose run --rm run task configure

# Run the validate task inside the devtools container.
docker-compose run --rm devcontainer task validate
docker-compose run --rm run task validate

# Run extensive tests inside the devtools container.
docker-compose run --rm devcontainer task EXTENSIVE=true test
docker-compose run --rm run task EXTENSIVE=true test

# To get a shell into the devcontainer docker image.
docker-compose run --rm devcontainer bash
docker-compose run --rm run bash

The devcontainer also works with `Podman Compose
<https://github.com/containers/podman-compose>`_.
Expand Down