-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
35 lines (29 loc) · 1.28 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# syntax=docker/dockerfile:1
ARG PYTHON_VERSION="3.13"
FROM mcr.microsoft.com/devcontainers/python:${PYTHON_VERSION}
LABEL org.opencontainers.image.authors="Ryan Boehning <[email protected]>"
RUN <<-EOT
mkdir -p --mode=755 /etc/apt/keyrings
wget --no-verbose --output-document=/etc/apt/keyrings/githubcli-archive-keyring.gpg https://cli.github.com/packages/githubcli-archive-keyring.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" > /etc/apt/sources.list.d/github-cli.list
apt update
apt full-upgrade
apt install gh --yes
apt clean
rm -rf /var/lib/apt/lists/*
EOT
# Change the vscode user's default shell to zsh.
RUN sed -i 's/\/home\/vscode:\/bin\/bash/\/home\/vscode:\/bin\/zsh/' /etc/passwd
USER vscode
# Remove shell configs from the base image.
RUN rm -rf ~/.bash_logout ~/.bashrc ~/.oh-my-zsh ~/.profile
# Enable pipefail to catch poetry install errors.
SHELL ["/bin/zsh", "-o", "pipefail", "-c"]
# Install poetry and enable its completions.
RUN <<-EOT
mkdir -p /home/vscode/.local/bin
curl -sSL https://install.python-poetry.org | python -
mkdir -p ~/.zfunc
poetry completions zsh > ~/.zfunc/_poetrywhic
fpath+=~/.zfunc
EOT