Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
111 changes: 0 additions & 111 deletions .github/workflows/build-and-push.yaml
Original file line number Diff line number Diff line change
@@ -1,111 +0,0 @@
name: Build and Push DevContainer Images

on:
pull_request:
branches:
- main
types:
- opened
- reopened
- synchronize
paths:
- "./dockerfiles/**"
workflow_dispatch:

jobs:
detect-changes:
name: Detect Changed Images
runs-on: ubuntu-24.04
outputs:
node: ${{ steps.changes.outputs.node }}
php+node: ${{ steps.changes.outputs.php-node }}
python: ${{ steps.changes.outputs.python }}
ubuntu: ${{ steps.changes.outputs.ubuntu }}
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Detect changes
id: changes
uses: dorny/paths-filter@v3
with:
filters: |
'node':
- 'dockerfiles/node/Dockerfile'
'php-node':
- 'dockerfiles/php-node/Dockerfile'
'python':
- 'dockerfiles/python/Dockerfile'
'ubuntu':
- 'dockerfiles/ubuntu/Dockerfile'

build-and-push:
name: Build ${{ matrix.image }}
needs: detect-changes
if: |
needs.detect-changes.outputs.node == 'true' ||
needs.detect-changes.outputs.php-node == 'true' ||
needs.detect-changes.outputs.python == 'true' ||
needs.detect-changes.outputs.ubuntu == 'true'
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
include:
- image: node
changed: ${{ needs.detect-changes.outputs.node }}
- image: php+node
changed: ${{ needs.detect-changes.outputs.php-node }}
- image: python
changed: ${{ needs.detect-changes.outputs.python }}
- image: ubuntu
changed: ${{ needs.detect-changes.outputs.ubuntu }}
steps:
- name: Skip if not changed
if: matrix.changed != 'true'
run: |
echo "Skipping ${{ matrix.image }} - no changes detected"
exit 0

- name: Checkout Repository
if: matrix.changed == 'true'
uses: actions/checkout@v4

- name: Set up Docker Buildx
if: matrix.changed == 'true'
uses: docker/setup-buildx-action@v3

- name: Log in to GitHub Container Registry
if: matrix.changed == 'true'
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata
if: matrix.changed == 'true'
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_PREFIX }}/devcontainer-${{ matrix.image }}
tags: |
type=raw,value=latest
type=sha,prefix={{branch}}-
type=ref,event=branch
type=semver,pattern={{version}}

- name: Build and push
if: matrix.changed == 'true'
uses: docker/build-push-action@v5
with:
context: ./dockerfiles/${{ matrix.image }}
file: ./dockerfiles/${{ matrix.image }}/Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
platforms: linux/amd64,linux/arm64
8 changes: 4 additions & 4 deletions dockerfiles/node/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
FROM appzic/dc:base-ubuntu-22.04
ARG BASE_IMAGE
FROM ${BASE_IMAGE}

ARG VERSION=20.x
ARG NODE_VERSION

USER vscode

RUN sudo apt-get update -y

# Install Node 20.x
RUN curl -fsSL https://deb.nodesource.com/setup_${VERSION} | sudo -E bash - &&\
RUN curl -fsSL https://deb.nodesource.com/setup_${NODE_VERSION} | sudo -E bash - &&\
sudo apt-get install -y nodejs
19 changes: 19 additions & 0 deletions dockerfiles/node/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
image:
name: ghcr.io/appzic/devcontainer-node
tags:
- tag: 18.x
args:
- base_image: ghcr.io/appzic/devcontainer-ubuntu:24.04
- node_version: 18.x
- tag: 20.x
args:
- base_image: ghcr.io/appzic/devcontainer-ubuntu:24.04
- node_version: 20.x
- tag: 22.x
args:
- base_image: ghcr.io/appzic/devcontainer-ubuntu:24.04
- node_version: 22.x
- tag: 24.x
args:
- base_image: ghcr.io/appzic/devcontainer-ubuntu:24.04
- node_version: 24.x
36 changes: 15 additions & 21 deletions dockerfiles/php-node/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,35 +1,29 @@
FROM appzic/dc:base-ubuntu-22.04
ARG BASE_IMAGE
FROM ${BASE_IMAGE}

ARG VERSION=8.1
ARG NODE_VERSION=18.x
ARG PHP_VERSION

USER vscode

RUN sudo apt-get update -y

# Install Node Js
RUN curl -fsSL https://deb.nodesource.com/setup_${NODE_VERSION} | sudo -E bash - &&\
sudo apt-get install -y nodejs

# Install php
RUN sudo add-apt-repository ppa:ondrej/php \
&& sudo apt-get update -y \
&& sudo apt-get install -y php${VERSION} \
&& sudo a2enmod php${VERSION}
&& sudo apt-get install -y php${PHP_VERSION} \
&& sudo a2enmod php${PHP_VERSION}

# Install composer
RUN curl -sS https://getcomposer.org/installer -o /tmp/composer-setup.php \
&& sudo php /tmp/composer-setup.php --install-dir=/usr/local/bin --filename=composer

# Install php modules
RUN sudo apt-get install -y \
php${VERSION}-cli \
php${VERSION}-common \
php${VERSION}-mysql \
php${VERSION}-zip \
php${VERSION}-gd \
php${VERSION}-mbstring \
php${VERSION}-curl \
php${VERSION}-xml \
php${VERSION}-bcmath \
php${VERSION}-sqlite3
php${PHP_VERSION}-cli \
php${PHP_VERSION}-common \
php${PHP_VERSION}-mysql \
php${PHP_VERSION}-zip \
php${PHP_VERSION}-gd \
php${PHP_VERSION}-mbstring \
php${PHP_VERSION}-curl \
php${PHP_VERSION}-xml \
php${PHP_VERSION}-bcmath \
php${PHP_VERSION}-sqlite3
11 changes: 11 additions & 0 deletions dockerfiles/php-node/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
image:
name: ghcr.io/appzic/devcontainer-php-node
tags:
- tag: php8.1-node20.x
args:
- base_image: ghcr.io/appzic/devcontainer-node:20.x
- php_version: 8.1
- tag: php8.3-node24.x
args:
- base_image: ghcr.io/appzic/devcontainer-node:24.x
- php_version: 8.3
13 changes: 7 additions & 6 deletions dockerfiles/python/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,21 +1,22 @@
FROM appzic/dc:base-ubuntu-22.04
ARG BASE_IMAGE
FROM ${BASE_IMAGE}

ARG VERSION=3.7.3
ARG PYTHON_VERSION

USER vscode

# Download extract and python source file
RUN cd /tmp && \
wget https://www.python.org/ftp/python/${VERSION}/Python-${VERSION}.tgz && \
sudo tar -xf ./Python-${VERSION}.tgz
wget https://www.python.org/ftp/python/${PYTHON_VERSION}/Python-${PYTHON_VERSION}.tgz && \
sudo tar -xf ./Python-${PYTHON_VERSION}.tgz

# Install
RUN cd /tmp/Python-${VERSION} &&\
RUN cd /tmp/Python-${PYTHON_VERSION} &&\
sudo ./configure --enable-optimizations &&\
sudo make install

# Remove .tgz file
RUN sudo rm -fr /tmp/Python-${VERSION}.tgz
RUN sudo rm -fr /tmp/Python-${PYTHON_VERSION}.tgz

# Install python packages
RUN sudo pip3 install pipenv
15 changes: 15 additions & 0 deletions dockerfiles/python/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
image:
name: ghcr.io/appzic/devcontainer-python
tags:
- tag: 3.7.3
args:
- base_image: ghcr.io/appzic/devcontainer-ubuntu:24.04
- python_version: 3.7.3
- tag: 3.12.2
args:
- base_image: ghcr.io/appzic/devcontainer-ubuntu:24.04
- python_version: 3.12.2
- tag: 3.14.0
args:
- base_image: ghcr.io/appzic/devcontainer-ubuntu:24.04
- python_version: 3.14.0
1 change: 0 additions & 1 deletion dockerfiles/ubuntu/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
ARG UBUNTU_VERSION

FROM mcr.microsoft.com/devcontainers/base:ubuntu-${UBUNTU_VERSION}

USER vscode
Expand Down