Skip to content

Commit 1a645c3

Browse files
sireeshajonnalagaddaabdurriqCopilot
authored
support Ubuntu 26.04 (resolute) (#1848)
* support Ubuntu 26.04 (resolute) * support Ubuntu 26.04 (resolute) * Update Dockerfile to handle 'resolute' variant in user deletion logic * Enhance user deletion logic and add support for 'resolute' variant in user checks * Enhance user deletion logic and add support for 'resolute' variant in user checks * Fix user deletion message in Dockerfile * Apply suggestion from @Copilot Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Fix formatting in manifest.json tags section --------- Co-authored-by: Abdurrahmaan Iqbal <abdurriq@github.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 9d508a1 commit 1a645c3

4 files changed

Lines changed: 31 additions & 18 deletions

File tree

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
ARG VARIANT="noble"
1+
ARG VARIANT="resolute"
22
FROM buildpack-deps:${VARIANT}-curl
33

44
LABEL dev.containers.features="common"
55

66
ARG VARIANT
7-
RUN if [ "$VARIANT" = "noble" ]; then \
8-
if id "ubuntu" &>/dev/null; then \
9-
echo "Deleting user 'ubuntu' for $VARIANT" && userdel -f -r ubuntu || echo "Failed to delete ubuntu user for $VARIANT"; \
10-
else \
11-
echo "User 'ubuntu' does not exist for $VARIANT"; \
12-
fi; \
7+
RUN if [ "$VARIANT" = "noble" ] || [ "$VARIANT" = "resolute" ]; then \
8+
if id "ubuntu" &>/dev/null; then \
9+
echo "Deleting user 'ubuntu' for $VARIANT" && userdel -f -r ubuntu || echo "Failed to delete ubuntu user for $VARIANT"; \
10+
else \
11+
echo "User 'ubuntu' does not exist for $VARIANT"; \
12+
fi; \
1313
fi
1414

1515
# [Optional] Uncomment this section to install additional OS packages.
@@ -20,4 +20,5 @@ RUN if [ "$VARIANT" = "noble" ]; then \
2020
RUN apt-get update \
2121
&& export DEBIAN_FRONTEND=noninteractive \
2222
&& apt-get -y reinstall --no-install-recommends tzdata \
23-
&& rm -rf /var/lib/apt/lists/*
23+
&& echo "Etc/UTC" > /etc/timezone \
24+
&& rm -rf /var/lib/apt/lists/*

src/base-ubuntu/README.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
| *Categories* | Core, Other |
1010
| *Image type* | Dockerfile |
1111
| *Published images* | mcr.microsoft.com/devcontainers/base:ubuntu |
12-
| *Available image variants* | ubuntu24.04 / noble, ubuntu22.04 / jammy ([full list](https://mcr.microsoft.com/v2/devcontainers/base/tags/list)) |
13-
| *Published image architecture(s)* | x86-64, aarch64/arm64 for `ubuntu22.04` (`jammy`) and `ubuntu24.04` (`noble`) variants |
12+
| *Available image variants* | ubuntu26.04 / resolute, ubuntu24.04 / noble, ubuntu22.04 / jammy ([full list](https://mcr.microsoft.com/v2/devcontainers/base/tags/list)) |
13+
| *Published image architecture(s)* | x86-64, aarch64/arm64 for `ubuntu26.04` (`resolute`) and `ubuntu24.04` (`noble`) and `ubuntu22.04` (`jammy`) variants |
1414
| *Container host OS support* | Linux, macOS, Windows |
1515
| *Container OS* | Ubuntu |
1616
| *Languages, platforms* | Any |
@@ -22,16 +22,17 @@ See **[history](history)** for information on the contents of published images.
2222
You can directly reference pre-built versions of `Dockerfile` by using the `image` property in `.devcontainer/devcontainer.json` or updating the `FROM` statement in your own `Dockerfile` to one of the following. An example `Dockerfile` is included in this repository.
2323

2424
- `mcr.microsoft.com/devcontainers/base:ubuntu` (latest LTS release)
25+
- `mcr.microsoft.com/devcontainers/base:ubuntu26.04` (or `resolute`)
2526
- `mcr.microsoft.com/devcontainers/base:ubuntu24.04` (or `noble`)
2627
- `mcr.microsoft.com/devcontainers/base:ubuntu22.04` (or `jammy`)
2728

2829
Refer to [this guide](https://containers.dev/guide/dockerfile) for more details.
2930

3031
You can decide how often you want updates by referencing a [semantic version](https://semver.org/) of each image. For example:
3132

32-
- `mcr.microsoft.com/devcontainers/base:2-jammy`
33-
- `mcr.microsoft.com/devcontainers/base:2.1-jammy`
34-
- `mcr.microsoft.com/devcontainers/base:2.1.8-jammy`
33+
- `mcr.microsoft.com/devcontainers/base:3-jammy`
34+
- `mcr.microsoft.com/devcontainers/base:3.0-jammy`
35+
- `mcr.microsoft.com/devcontainers/base:3.0.0-jammy`
3536

3637
See [history](history) for information on the contents of each version and [here for a complete list of available tags](https://mcr.microsoft.com/v2/devcontainers/base/tags/list).
3738

src/base-ubuntu/manifest.json

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,18 @@
11
{
2-
"version": "2.1.8",
2+
"version": "3.0.0",
33
"variants": [
4+
"resolute",
45
"noble",
56
"jammy"
67
],
78
"build": {
89
"latest": false,
910
"rootDistro": "debian",
1011
"architectures": {
12+
"resolute": [
13+
"linux/amd64",
14+
"linux/arm64"
15+
],
1116
"noble": [
1217
"linux/amd64",
1318
"linux/arm64"
@@ -21,10 +26,13 @@
2126
"base:${VERSION}-${VARIANT}"
2227
],
2328
"variantTags": {
24-
"noble": [
25-
"base:${VERSION}-ubuntu24.04",
29+
"resolute": [
30+
"base:${VERSION}-ubuntu26.04",
2631
"base:${VERSION}-ubuntu"
2732
],
33+
"noble": [
34+
"base:${VERSION}-ubuntu24.04"
35+
],
2836
"jammy": [
2937
"base:${VERSION}-ubuntu22.04"
3038
]
@@ -40,4 +48,4 @@
4048
"git": {}
4149
}
4250
}
43-
}
51+
}

src/base-ubuntu/test-project/test.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,11 @@ check_ubuntu_user() {
3232
if grep -q 'VERSION_CODENAME=noble' /etc/os-release; then
3333
echo -e "\nThe base image is ubuntu:noble. Checking user Ubuntu.."
3434
check "uid" "check_ubuntu_user"
35+
elif grep -q 'VERSION_CODENAME=resolute' /etc/os-release; then
36+
echo -e "\nThe base image is ubuntu:resolute. Checking user Ubuntu.."
37+
check "uid" "check_ubuntu_user"
3538
else
36-
echo -e "\nCannot check user Ubuntu. The base image is not ubuntu:noble."
39+
echo -e "\nCannot check user Ubuntu. The base image is not ubuntu:noble or ubuntu:resolute."
3740
fi
3841

3942
# Report result

0 commit comments

Comments
 (0)