Skip to content

Commit

Permalink
feat: bump image and bump actions versions
Browse files Browse the repository at this point in the history
  • Loading branch information
ryboe committed Nov 24, 2023
1 parent dabb878 commit 780e963
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 25 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Set up Docker buildx
uses: docker/setup-buildx-action@v2
uses: docker/setup-buildx-action@v3
- name: Log in to GHCR
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ github.token }}
- name: Build image
uses: docker/build-push-action@v3
uses: docker/build-push-action@v5
with:
cache-from: type=gha
platforms: linux/amd64 # GitHub only offers AMD64 codespaces
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Set up Docker buildx
uses: docker/setup-buildx-action@v2
uses: docker/setup-buildx-action@v3
- name: Log in to GHCR
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ github.token }}
- name: Build and Push
uses: docker/build-push-action@v3
uses: docker/build-push-action@v5
with:
platforms: linux/amd64 # GitHub only offers AMD64 codespaces
pull: true
Expand Down
38 changes: 19 additions & 19 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
# syntax=docker/dockerfile:1
ARG PYTHON_VERSION="3.11"
ARG PYTHON_VERSION="3.12"
FROM mcr.microsoft.com/devcontainers/python:${PYTHON_VERSION}

LABEL org.opencontainers.image.authors="Ryan Boehning <[email protected]>"

RUN <<-EOT
apt update
apt full-upgrade
rm -rf /var/lib/apt/lists/*
apt update
apt full-upgrade
apt clean
rm -rf /var/lib/apt/lists/*
EOT

# Enable pipefail to catch errors.
Expand All @@ -17,26 +18,25 @@ SHELL ["/bin/zsh", "-o", "pipefail", "-c"]
RUN sed -i 's/\/home\/vscode:\/bin\/bash/\/home\/vscode:\/bin\/zsh/' /etc/passwd
USER vscode

# Create local bin directory for gh, poetry, and other command line tools.
RUN mkdir -p /home/vscode/.local/bin
ENV PATH="/home/vscode/.local/bin:$PATH"

# Remove shell configs from the base image.
RUN rm -rf ~/.bash_logout ~/.bashrc ~/.oh-my-zsh ~/.profile

# Install the latest gh CLI tool. The first request fetches the URL for the
# latest release tarball. The second request downloads the tarball.
# Create local bin directory for gh, poetry, and other command line tools.
RUN mkdir -p /home/vscode/.local/bin

# Install poetry and enable its completions.
RUN <<-EOT
wget --quiet --timeout=30 --output-document=- 'https://api.github.com/repos/cli/cli/releases/latest' |
jq -r ".assets[] | select(.name | test(\"gh_.*?_linux_amd64.tar.gz\")).browser_download_url" |
wget --quiet --timeout=180 --input-file=- --output-document=- |
tar -xvz -C /home/vscode/.local/ --strip-components=1
curl -sSL https://install.python-poetry.org | python -
mkdir -p ~/.zfunc
poetry completions zsh > ~/.zfunc/_poetrywhic
fpath+=~/.zfunc
EOT

# Install poetry and enable its completions.
# Install the latest gh CLI tool. The first request fetches the URL for the
# latest release tarball. The second request downloads the tarball.
RUN <<-EOT
curl -sSL https://install.python-poetry.org | python -
mkdir -p ~/.zfunc
poetry completions zsh > ~/.zfunc/_poetrywhic
fpath+=~/.zfunc
wget --quiet --timeout=30 --output-document=- 'https://api.github.com/repos/cli/cli/releases/latest' |
jq -r ".assets[] | select(.name | test(\"gh_.*?_linux_amd64.tar.gz\")).browser_download_url" |
wget --quiet --timeout=180 --input-file=- --output-document=- |
tar -xvz -C ~/.local/bin --strip-components=2
EOT

0 comments on commit 780e963

Please sign in to comment.