Skip to content

Commit 7517ac5

Browse files
CopilotKaniska244
andauthored
Update template images to match devcontainers/images repository versions (#405)
* Initial plan * fix: sync template image versions with devcontainers/images manifests Updated the following image version references to match the current versions in devcontainers/images manifest.json files: - typescript-node: 1 → 4 (manifest version 4.0.6) - javascript-node: 1 → 4 (manifest version 4.0.8) - python: 2 → 3, 1 → 3 (manifest version 3.0.5) - java: 1 → 3 (manifest version 3.0.5) - cpp: 1 → 2 (manifest version 2.1.5) - ruby: 2 → 3 (manifest version 3.0.2) All updated tags verified to exist on MCR registry. Co-authored-by: Kaniska244 <[email protected]> * revert: undo ruby and ruby-rails-postgres template changes Co-authored-by: Kaniska244 <[email protected]> * feat: add missing trixie variants, update defaults, and bump major versions Updated devcontainer-template.json for all templates where image versions were changed: - typescript-node: 4.0.2 → 5.0.0, add trixie variants, default 24-trixie - javascript-node: 4.0.2 → 5.0.0, add trixie variants, default 24-trixie - javascript-node-postgres: 4.0.2 → 5.0.0, add trixie variants, default 24-trixie - javascript-node-mongo: 4.0.2 → 5.0.0, add trixie variants, default 24-trixie - python: 5.0.0 → 6.0.0 - postgres: 2.2.0 → 3.0.0, add trixie/newer Python variants, default 3.14-trixie - java: 4.0.2 → 5.0.0, add trixie/Java 25 variants, default 25-trixie - java-postgres: 4.0.2 → 5.0.0, add trixie/Java 25 variants, default 25-trixie - cpp: 3.1.0 → 4.0.0, add debian13 (trixie), default debian13 - cpp-mariadb: 3.1.0 → 4.0.0, add debian13 (trixie), default debian13 All new tags verified on MCR registry. Co-authored-by: Kaniska244 <[email protected]> * fix: replace flaky GitHub maven-wrapper download with Apache Maven in java-postgres test.sh Co-authored-by: Kaniska244 <[email protected]> * revert: rollback java-postgres test.sh to original maven-wrapper version Co-authored-by: Kaniska244 <[email protected]> * fix: replace network_mode with bridge network in java-postgres docker-compose and update test.sh Co-authored-by: Kaniska244 <[email protected]> * fix: revert test/java-postgres/test.sh to baseline and fix typo on line 14 Co-authored-by: Kaniska244 <[email protected]> * fix: update postgres volume mount path for PostgreSQL 18+ compatibility Co-authored-by: Kaniska244 <[email protected]> * fix: update javascript-node-postgres network config and postgres volume mount Replace network_mode: service:db with bridge network (app-network) to fix DNS resolution failures in CI. Update postgres volume mount from /var/lib/postgresql/data to /var/lib/postgresql for PostgreSQL 18+ compatibility. Update NOTES.md to reflect hostname db instead of localhost. Co-authored-by: Kaniska244 <[email protected]> * fix: update javascript-node-postgres test db host from localhost to db Update the PostgreSQL connection host in test/javascript-node-postgres/server.js from 'localhost' to 'db' to match the bridge network configuration change in docker-compose.yml. Co-authored-by: Kaniska244 <[email protected]> * Remove trixie variants from javascript-node-mongo and default to 24-bookworm MongoDB packages are not available for Debian Trixie (13), causing test failures. Removed all trixie variants and changed the default to 24-bookworm. Co-authored-by: Kaniska244 <[email protected]> * Include php, php-mariadb, and jekyll template changes from closed PR #406 - php: Removed bullseye variants, added 8.2-trixie and 8.2-bookworm, reordered proposals - php-mariadb: Removed bullseye variants, added 8.2-trixie and 8.2-bookworm, reordered proposals - jekyll: Removed obsolete buster variant Co-authored-by: Kaniska244 <[email protected]> * Remove invalid Python variants not present in MCR Removed Python 3.9 variants (3.9-trixie, 3.9-bookworm, 3.9-bullseye) and all bullseye variants (3-bullseye, 3.14-bullseye through 3.10-bullseye) from the python template - these tags do not exist in MCR with the version 3 prefix. Verified all remaining variants across all templates against MCR. Co-authored-by: Kaniska244 <[email protected]> * Add 8-trixie and 8-bookworm variants to java and java-postgres templates Added Java 8 variants (8-trixie, 8-bookworm) to both java and java-postgres devcontainer-template.json proposals. Tags verified against MCR. Co-authored-by: Kaniska244 <[email protected]> --------- Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: Kaniska244 <[email protected]> Co-authored-by: Kaniska <[email protected]>
1 parent fc23cf4 commit 7517ac5

29 files changed

Lines changed: 146 additions & 131 deletions

File tree

src/cpp-mariadb/.devcontainer/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM mcr.microsoft.com/devcontainers/cpp:1-${templateOption:imageVariant}
1+
FROM mcr.microsoft.com/devcontainers/cpp:2-${templateOption:imageVariant}
22

33
# Everything below this is needed for installing MariaDB
44
# Instructions are copied and modified from: https://mariadb.com/docs/clients/mariadb-connectors/connector-cpp/install/

src/cpp-mariadb/devcontainer-template.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"id": "cpp-mariadb",
3-
"version": "3.1.0",
3+
"version": "4.0.0",
44
"name": "C++ & MariaDB",
55
"description": "Develop C++ applications on Linux. Includes Debian C++ build tools.",
66
"documentationURL": "https://github.com/devcontainers/templates/tree/main/src/cpp-mariadb",
@@ -9,14 +9,14 @@
99
"options": {
1010
"imageVariant": {
1111
"type": "string",
12-
"description": "Debian / Ubuntu version (use Debian 12, Debian 11, Ubuntu 24.04, and Ubuntu 22.04 on local arm64/Apple Silicon):",
12+
"description": "Debian / Ubuntu version (use Debian 13, Debian 12, Ubuntu 24.04, and Ubuntu 22.04 on local arm64/Apple Silicon):",
1313
"proposals": [
14+
"debian13",
1415
"debian12",
15-
"debian11",
1616
"ubuntu24.04",
1717
"ubuntu22.04"
1818
],
19-
"default": "debian12"
19+
"default": "debian13"
2020
},
2121
"reinstallCmakeVersionFromSource": {
2222
"type": "string",

src/cpp/.devcontainer/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM mcr.microsoft.com/devcontainers/cpp:1-${templateOption:imageVariant}
1+
FROM mcr.microsoft.com/devcontainers/cpp:2-${templateOption:imageVariant}
22

33
ARG REINSTALL_CMAKE_VERSION_FROM_SOURCE="${templateOption:reinstallCmakeVersionFromSource}"
44

src/cpp/devcontainer-template.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"id": "cpp",
3-
"version": "3.1.0",
3+
"version": "4.0.0",
44
"name": "C++",
55
"description": "Develop C++ applications on Linux. Includes Debian C++ build tools.",
66
"documentationURL": "https://github.com/devcontainers/templates/tree/main/src/cpp",
@@ -9,14 +9,14 @@
99
"options": {
1010
"imageVariant": {
1111
"type": "string",
12-
"description": "Debian / Ubuntu version (use Debian 12, Debian 11, Ubuntu 24.04, and Ubuntu 22.04 on local arm64/Apple Silicon):",
12+
"description": "Debian / Ubuntu version (use Debian 13, Debian 12, Ubuntu 24.04, and Ubuntu 22.04 on local arm64/Apple Silicon):",
1313
"proposals": [
14+
"debian13",
1415
"debian12",
15-
"debian11",
1616
"ubuntu24.04",
1717
"ubuntu22.04"
1818
],
19-
"default": "debian12"
19+
"default": "debian13"
2020
},
2121
"reinstallCmakeVersionFromSource": {
2222
"type": "string",

src/java-postgres/.devcontainer/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM mcr.microsoft.com/devcontainers/java:1-${templateOption:imageVariant}
1+
FROM mcr.microsoft.com/devcontainers/java:3-${templateOption:imageVariant}
22

33
ARG INSTALL_MAVEN="${templateOption:installMaven}"
44
ARG MAVEN_VERSION=""

src/java-postgres/.devcontainer/docker-compose.yml

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
version: '3.8'
2-
31
volumes:
42
postgres-data:
53

@@ -14,16 +12,21 @@ services:
1412
POSTGRES_PASSWORD: postgres
1513
POSTGRES_USER: postgres
1614
POSTGRES_DB: postgres
17-
POSTGRES_HOSTNAME: postgresdb
15+
POSTGRES_HOSTNAME: db
1816

1917
volumes:
2018
- ../..:/workspaces:cached
2119

2220
# Overrides default command so things don't shut down after the process ends.
2321
command: sleep infinity
2422

25-
# Runs app on the same network as the database container, allows "forwardPorts" in devcontainer.json function.
26-
network_mode: service:db
23+
# Use proper Docker networking instead of network_mode: service:db
24+
# to ensure reliable DNS resolution in all environments
25+
depends_on:
26+
db:
27+
condition: service_healthy
28+
networks:
29+
- app-network
2730

2831
# Use "forwardPorts" in **devcontainer.json** to forward an app port locally.
2932
# (Adding the "ports" property to this file will not forward from a Codespace.)
@@ -32,13 +35,25 @@ services:
3235
container_name: postgresdb
3336
image: postgres:latest
3437
restart: unless-stopped
38+
networks:
39+
- app-network
40+
healthcheck:
41+
test: ["CMD-SHELL", "pg_isready -U postgres"]
42+
interval: 10s
43+
timeout: 5s
44+
retries: 5
45+
start_period: 30s
3546
volumes:
36-
- postgres-data:/var/lib/postgresql/data
47+
- postgres-data:/var/lib/postgresql
3748
environment:
3849
# NOTE: POSTGRES_DB/USER/PASSWORD should match values in app container
3950
POSTGRES_PASSWORD: postgres
4051
POSTGRES_USER: postgres
4152
POSTGRES_DB: postgres
4253

4354
# Add "forwardPorts": ["5432"] to **devcontainer.json** to forward PostgreSQL locally.
44-
# (Adding the "ports" property to this file will not forward from a Codespace.)
55+
# (Adding the "ports" property to this file will not forward from a Codespace.)
56+
57+
networks:
58+
app-network:
59+
driver: bridge

src/java-postgres/NOTES.md

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ This template references an image that was [pre-built](https://containers.dev/im
55

66
## Using this template
77

8-
This template creates two containers, one for Java and one for PostgreSQL. You will be connected to the Java container, and from within that container the PostgreSQL container will be available on **`localhost`** port 5432. The default database is named `postgres` with a user of `postgres` whose password is `postgres`, and if desired this may be changed in `.devcontainer/docker-compose.yml`. Data is stored in a volume named `postgres-data`.
8+
This template creates two containers, one for Java and one for PostgreSQL. You will be connected to the Java container, and from within that container the PostgreSQL container will be available on the hostname **`db`** port 5432. The default database is named `postgres` with a user of `postgres` whose password is `postgres`, and if desired this may be changed in `.devcontainer/docker-compose.yml`. Data is stored in a volume named `postgres-data`.
99

1010
While the template itself works unmodified, it uses the `mcr.microsoft.com/devcontainers/java` image which includes `git`, a non-root `vscode` user with `sudo` access, and a set of common dependencies and Java tools for development.
1111

@@ -28,12 +28,7 @@ If needed, you can use `postCreateCommand` to run commands after the container i
2828

2929
### Adding another service
3030

31-
You can add other services to your `.devcontainer/docker-compose.yml` file [as described in Docker's documentation](https://docs.docker.com/compose/compose-file/#service-configuration-reference). However, if you want anything running in this service to be available in the container on localhost, or want to forward the service locally, be sure to add this line to the service config:
32-
33-
```yaml
34-
# Runs the service on the same network as the database container, allows "forwardPorts" in devcontainer.json function.
35-
network_mode: service:db
36-
```
31+
You can add other services to your `.devcontainer/docker-compose.yml` file [as described in Docker's documentation](https://docs.docker.com/compose/compose-file/#service-configuration-reference). For inter-service communication, attach new services to the `app-network` bridge network configured in the compose file.
3732

3833
### Using the forwardPorts property
3934

src/java-postgres/devcontainer-template.json

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"id": "java-postgres",
3-
"version": "4.0.2",
3+
"version": "5.0.0",
44
"name": "Java & PostgreSQL",
55
"description": "Develop applications with Java and PostgreSQL. Includes a Java application container and PostgreSQL server.",
66
"documentationURL": "https://github.com/devcontainers/templates/tree/main/src/java-postgres",
@@ -9,18 +9,20 @@
99
"options": {
1010
"imageVariant": {
1111
"type": "string",
12-
"description": "Java version (use -bookworm, or -bullseye variants on local arm64/Apple Silicon):",
12+
"description": "Java version (use -trixie, or -bookworm variants on local arm64/Apple Silicon):",
1313
"proposals": [
14+
"25-trixie",
15+
"21-trixie",
16+
"17-trixie",
17+
"11-trixie",
18+
"8-trixie",
19+
"25-bookworm",
1420
"21-bookworm",
1521
"17-bookworm",
1622
"11-bookworm",
17-
"8-bookworm",
18-
"21-bullseye",
19-
"17-bullseye",
20-
"11-bullseye",
21-
"8-bullseye"
23+
"8-bookworm"
2224
],
23-
"default": "21-bullseye"
25+
"default": "25-trixie"
2426
},
2527
"installMaven": {
2628
"type": "boolean",

src/java/.devcontainer/devcontainer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
{
44
"name": "Java",
55
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
6-
"image": "mcr.microsoft.com/devcontainers/java:1-${templateOption:imageVariant}",
6+
"image": "mcr.microsoft.com/devcontainers/java:3-${templateOption:imageVariant}",
77

88
"features": {
99
"ghcr.io/devcontainers/features/java:1": {

src/java/devcontainer-template.json

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"id": "java",
3-
"version": "4.0.2",
3+
"version": "5.0.0",
44
"name": "Java",
55
"description": "Develop Java applications. Includes the JDK and Java extensions.",
66
"documentationURL": "https://github.com/devcontainers/templates/tree/main/src/java",
@@ -9,18 +9,20 @@
99
"options": {
1010
"imageVariant": {
1111
"type": "string",
12-
"description": "Java version (use -bookworm, or -bullseye variants on local arm64/Apple Silicon):",
12+
"description": "Java version (use -trixie, or -bookworm variants on local arm64/Apple Silicon):",
1313
"proposals": [
14+
"25-trixie",
15+
"21-trixie",
16+
"17-trixie",
17+
"11-trixie",
18+
"8-trixie",
19+
"25-bookworm",
1420
"21-bookworm",
1521
"17-bookworm",
1622
"11-bookworm",
17-
"8-bookworm",
18-
"21-bullseye",
19-
"17-bullseye",
20-
"11-bullseye",
21-
"8-bullseye"
23+
"8-bookworm"
2224
],
23-
"default": "21-bullseye"
25+
"default": "25-trixie"
2426
},
2527
"installMaven": {
2628
"type": "boolean",

0 commit comments

Comments
 (0)