Skip to content

Commit

Permalink
📌 Update base image to Ubuntu 24.04 (#72)
Browse files Browse the repository at this point in the history
Signed-off-by: Jacob Woffenden <[email protected]>
  • Loading branch information
Jacob Woffenden authored May 13, 2024
1 parent e33b736 commit e07e216
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 19 deletions.
7 changes: 7 additions & 0 deletions images/base/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [2.0.0] - 2024-05-13

### Changed

- Updated image to Ubuntu 24.04
- Updated references to `1000`, `vscode` user is now `1001`

## [1.0.0] - 2024-04-16

### Changed
Expand Down
10 changes: 2 additions & 8 deletions images/base/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#checkov:skip=CKV_DOCKER_3: USER not required - A non-root user is created, and used by VS Code's Remote Containers extension
# hadolint global ignore=DL3008,DL3013

FROM mcr.microsoft.com/devcontainers/base:ubuntu-22.04
FROM mcr.microsoft.com/devcontainers/base:ubuntu-24.04

LABEL org.opencontainers.image.vendor="Ministry of Justice" \
org.opencontainers.image.authors="Dev Container Community" \
Expand All @@ -22,16 +22,13 @@ apt-get update --yes

apt-get upgrade --yes

apt-get install --yes --no-install-recommends \
apt-get install --yes \
python3-pip

apt-get clean --yes

rm --force --recursive /var/lib/apt/lists/*

python3 -m pip install --no-cache-dir --upgrade \
pip

chsh --shell "$(which zsh)" vscode

cat /home/vscode/.zshrc.snippet >> /home/vscode/.zshrc
Expand All @@ -56,7 +53,4 @@ apt-get upgrade --yes
apt-get clean --yes

rm --force --recursive /var/lib/apt/lists/*

python3 -m pip install --no-cache-dir --upgrade \
pip
EOF
2 changes: 1 addition & 1 deletion images/base/config.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"name": "base",
"version": "1.0.0"
"version": "2.0.0"
}
2 changes: 1 addition & 1 deletion images/base/src/usr/local/bin/devcontainer-utils
Original file line number Diff line number Diff line change
Expand Up @@ -77,5 +77,5 @@ apt_install() {
pip_install() {
local packages="${1}"

python3 -m pip install --no-cache-dir --upgrade "${packages}"
python3 -m pip install --no-cache-dir --upgrade --break-system-packages "${packages}"
}
18 changes: 9 additions & 9 deletions images/base/test/container-structure-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@ commandTests:
- name: "vscode user"
command: "id"
args: ["--user", "vscode"]
expectedOutput: ["1000"]
expectedOutput: ["1001"]

- name: "vscode group"
command: "id"
args: ["--group", "vscode"]
expectedOutput: ["1000"]
expectedOutput: ["1001"]

- name: "vscode user getent"
command: "getent"
args: ["passwd", "vscode" ]
expectedOutput: ["vscode:x:1000:1000::/home/vscode:/usr/bin/zsh"]
expectedOutput: ["vscode:x:1001:1001::/home/vscode:/usr/bin/zsh"]

- name: "pip"
command: "pip"
Expand All @@ -41,22 +41,22 @@ fileExistenceTests:
path: "/home/vscode/.oh-my-zsh/custom/themes/devcontainers.zsh-theme"
shouldExist: true
permissions: "-rwxr-xr-x" # 0755
uid: 1000
gid: 1000
uid: 1001
gid: 1001

- name: "featurerc.d"
path: "/home/vscode/.devcontainer/featurerc.d"
shouldExist: true
permissions: "drwxr-xr-x" # 0755
uid: 1000
gid: 1000
uid: 1001
gid: 1001

- name: "promptrc.d"
path: "/home/vscode/.devcontainer/promptrc.d"
shouldExist: true
permissions: "drwxr-xr-x" # 0755
uid: 1000
gid: 1000
uid: 1001
gid: 1001

fileContentTests:
- name: "zshrc featurerc.d"
Expand Down

0 comments on commit e07e216

Please sign in to comment.