Skip to content

Commit

Permalink
use lighter Docker image
Browse files Browse the repository at this point in the history
  • Loading branch information
adehad committed Jan 17, 2024
1 parent 2469791 commit 27895b3
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 14 deletions.
10 changes: 6 additions & 4 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
# See here for image contents: https://github.com/devcontainers/images/blob/main/src/base-ubuntu/.devcontainer/Dockerfile

# [Choice] Ubuntu version: https://github.com/devcontainers/images/tree/main/src/base-ubuntu
ARG VARIANT="ubuntu-22.04"
FROM mcr.microsoft.com/vscode/devcontainers/base:${VARIANT}
# https://hub.docker.com/_/python
ARG VARIANT="bookworm"
ARG PYTHON="3.12"
FROM python:${PYTHON}-${VARIANT}

RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
&& apt-get -y install --no-install-recommends \
qt6-base-dev \
qt6-tools-dev \
qt6-tools-dev-tools \
qt6-wayland \
qt6-l10n-tools
qt6-l10n-tools \
qtchooser

RUN qtchooser -install qt6 $(which qmake6)

Expand Down
13 changes: 4 additions & 9 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,11 @@
{
"name": "Ubuntu",
"name": "Debian",
"build": {
"dockerfile": "Dockerfile",
// Update 'VARIANT' to pick an Ubuntu version
// Update 'VARIANT' to pick an Debian version
"args": {
"VARIANT": "ubuntu-22.04"
}
},
"features": {
"ghcr.io/devcontainers/features/python:1": {
"version": "3.12",
"optimize": true
"VARIANT": "bookworm",
"PYTHON": "3.12"
}
},
// Use 'postCreateCommand' to run commands after the container is created.
Expand Down
13 changes: 12 additions & 1 deletion .devcontainer/post_create.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,20 @@
#!/bin/bash

git config --global --add safe.directory /workspaces/py-scantailor-advanced
git config --global --add safe.directory /workspaces/py-scantailor-advanced

# Install pipx
python -m pip install pipx
pipx ensurepath

# Allow path changes
. ~/.bashrc

# Install pdm and pre-commit
pipx install pre-commit
pipx install pdm

pdm install

RED='\033[0;31m'
NC='\033[0m' # No Color
echo -e "${RED}You may need to 'Reload Window' in VSCode for it to pick up the updated interpreter${NC}"

0 comments on commit 27895b3

Please sign in to comment.