Skip to content

Commit

Permalink
Merge branch 'main' into patch-1
Browse files Browse the repository at this point in the history
  • Loading branch information
lemesdaniel authored May 16, 2024
2 parents 267e55b + 2c11396 commit e527724
Show file tree
Hide file tree
Showing 7 changed files with 34 additions and 9 deletions.
15 changes: 14 additions & 1 deletion .github/workflows/devcontainer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,16 @@ on:
jobs:
devcontainer:
runs-on: ubuntu-latest
strategy:
matrix:
include:
- php: 81
php-str: 8.1
- php: 82
php-str: 8.2
- php: 83
php-str: 8.3

steps:
-
name: Checkout
Expand All @@ -28,8 +38,11 @@ jobs:
-
name: Build and run dev container task
uses: devcontainers/[email protected]
env:
PHP_VERSION: ${{ matrix.php }}
PHP_VERSION_STR: ${{ matrix.php-str }}
with:
subFolder: src-devc
imageName: opencodeco/phpctl
imageTag: php83-devcontainer
imageTag: php${{ matrix.php }}-devcontainer
push: always
4 changes: 3 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,14 @@ ARG WITHOUT_WATCHR
ENV WITHOUT_WATCHR=$WITHOUT_WATCHR

COPY rootfs /
RUN apk add --upgrade --update --no-cache \
RUN apk update && apk upgrade && apk add --no-cache \
git \
docker-cli \
php${PHP}-cli \
php${PHP}-ctype \
php${PHP}-curl \
php${PHP}-dom \
php${PHP}-ffi \
php${PHP}-fileinfo \
php${PHP}-gd \
php${PHP}-iconv \
Expand Down
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ test:
install:
@sudo ./scripts/symlink-bins.sh

.PHONY: devcontainer
devcontainer:
@devcontainer build --workspace-folder src-devc --push true --image-name opencodeco/phpctl:php83-devcontainer
.PHONY: devcontainers
devcontainers:
@parallel --line-buffer PHP_VERSION={} ./src-devc/build.sh ::: 81 82 83
7 changes: 5 additions & 2 deletions src-devc/.devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
FROM php:8.3-bookworm
ARG PHP_VERSION 83
ARG PHP_VERSION_STR 8.3
FROM php:${PHP_VERSION_STR}-cli-bookworm
ENV PHP_VERSION $PHP_VERSION
COPY rootfs /
ADD --chmod=0755 https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
&& apt-get -y install --no-install-recommends libcurl4-openssl-dev libc-ares-dev libsqlite3-dev libpq-dev git unzip wget \
&& apt-get -y install --no-install-recommends libcurl4-openssl-dev libc-ares-dev libsqlite3-dev libpq-dev git parallel unzip wget \
&& mv /usr/local/etc/php/php.ini-development /usr/local/etc/php/php.ini \
&& mv /etc/php/php.ini /usr/local/etc/php/conf.d/zzphp.ini \
&& install-php-extensions sockets && install-swoole && install-tools
6 changes: 5 additions & 1 deletion src-devc/.devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
{
"build": {
"dockerfile": "./Dockerfile",
"context": "../.."
"context": "../..",
"args": {
"PHP_VERSION": "${localEnv:PHP_VERSION}",
"PHP_VERSION_STR": "${localEnv:PHP_VERSION_STR}"
}
},
"features": {
"ghcr.io/devcontainers/features/common-utils:2": {
Expand Down
3 changes: 3 additions & 0 deletions src-devc/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/usr/bin/env bash
export PHP_VERSION_STR="${PHP_VERSION:0:1}.${PHP_VERSION:1}"
devcontainer build --workspace-folder src-devc --push true --image-name "opencodeco/phpctl:php$PHP_VERSION-devcontainer"
2 changes: 1 addition & 1 deletion src/docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ run() {
if [ -n "$GIT_EXEC_PATH" ]; then
# In a Git hook environment, we need to disable TTY allocation
PHPCTL_TTY="--label=no-tty"
fi
fi

# shellcheck disable=SC2046
# shellcheck disable=SC2068
Expand Down

0 comments on commit e527724

Please sign in to comment.