11# syntax=docker/dockerfile:1
2- ARG PYTHON_VERSION="3.11 "
2+ ARG PYTHON_VERSION="3.12 "
33FROM mcr.microsoft.com/devcontainers/python:${PYTHON_VERSION}
44
55LABEL org.opencontainers.image.authors="Ryan Boehning <1250684+ryboe@users.noreply.github.com>"
66
77RUN <<-EOT
8- apt update
9- apt full-upgrade
10- rm -rf /var/lib/apt/lists/*
8+ apt update
9+ apt full-upgrade
10+ apt clean
11+ rm -rf /var/lib/apt/lists/*
1112EOT
1213
1314# Enable pipefail to catch errors.
@@ -17,26 +18,25 @@ SHELL ["/bin/zsh", "-o", "pipefail", "-c"]
1718RUN sed -i 's/\/ home\/ vscode:\/ bin\/ bash/\/ home\/ vscode:\/ bin\/ zsh/' /etc/passwd
1819USER vscode
1920
20- # Create local bin directory for gh, poetry, and other command line tools.
21- RUN mkdir -p /home/vscode/.local/bin
22- ENV PATH="/home/vscode/.local/bin:$PATH"
23-
2421# Remove shell configs from the base image.
2522RUN rm -rf ~/.bash_logout ~/.bashrc ~/.oh-my-zsh ~/.profile
2623
27- # Install the latest gh CLI tool. The first request fetches the URL for the
28- # latest release tarball. The second request downloads the tarball.
24+ # Create local bin directory for gh, poetry, and other command line tools.
25+ RUN mkdir -p /home/vscode/.local/bin
26+
27+ # Install poetry and enable its completions.
2928RUN <<-EOT
30- wget --quiet --timeout=30 --output-document=- ' https://api.github.com/repos/cli/cli/releases/latest' |
31- jq -r ".assets[] | select(.name | test( \" gh_.*?_linux_amd64.tar.gz \" )).browser_download_url" |
32- wget --quiet --timeout=180 --input-file=- --output-document=- |
33- tar -xvz -C /home/vscode/.local/ --strip-components=1
29+ curl -sSL https://install.python-poetry.org | python -
30+ mkdir -p ~/.zfunc
31+ poetry completions zsh > ~/.zfunc/_poetrywhic
32+ fpath+=~/.zfunc
3433EOT
3534
36- # Install poetry and enable its completions.
35+ # Install the latest gh CLI tool. The first request fetches the URL for the
36+ # latest release tarball. The second request downloads the tarball.
3737RUN <<-EOT
38- curl -sSL https://install.python-poetry.org | python -
39- mkdir -p ~/.zfunc
40- poetry completions zsh > ~/.zfunc/_poetrywhic
41- fpath+= ~/.zfunc
38+ wget --quiet --timeout=30 --output-document=- ' https://api.github.com/repos/cli/cli/releases/latest' |
39+ jq -r ".assets[] | select(.name | test( \" gh_.*?_linux_amd64.tar.gz \" )).browser_download_url" |
40+ wget --quiet --timeout=180 --input-file=- --output-document=- |
41+ tar -xvz -C ~/.local/bin --strip-components=2
4242EOT
0 commit comments