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
1 change: 1 addition & 0 deletions .github/prompts/update-project.prompt.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ All three Dockerfiles share the same versions for the following builder-stage to
`composer/composer`
- `XDEBUG_VERSION` — `xdebug/xdebug` on Packagist
- `PCOV_VERSION` — `pecl/pcov` on Packagist
- `FIXUID_VERSION` — check the GitHub Releases API for `boxboat/fixuid`

Process each tool individually and in order:

Expand Down
44 changes: 44 additions & 0 deletions apache/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,50 @@ RUN apt-get update \
&& rm -rf /var/lib/apt/lists/* \
&& rm -rf /tmp/*

# Latest version of fixuid: https://github.com/boxboat/fixuid/releases/latest
ARG FIXUID_VERSION=0.6.0

ARG USER=code
ARG GROUP=code
ARG USER_UID=1000
ARG USER_GID=1000
ARG TARGETARCH

SHELL ["/bin/bash", "-o", "pipefail", "-c"]

RUN curl -fsSLo /tmp/fixuid.tar.gz "https://github.com/boxboat/fixuid/releases/download/v$FIXUID_VERSION/fixuid-${FIXUID_VERSION}-linux-${TARGETARCH}.tar.gz" \
&& tar -xf /tmp/fixuid.tar.gz -C /usr/local/bin fixuid \
&& chown root:root /usr/local/bin/fixuid \
&& chmod 4755 /usr/local/bin/fixuid \
&& rm /tmp/fixuid.tar.gz \
# Create user and group, and setup fixuid configuration
&& existing_group="$(getent group "$USER_GID" | cut -d: -f1 || true)" \
&& if [ -z "$existing_group" ]; then \
groupadd --gid "$USER_GID" "$GROUP"; \
existing_group="$GROUP"; \
fi \
&& useradd --uid "$USER_UID" --gid "$USER_GID" --create-home "$USER" --shell /bin/bash \
&& mkdir -p \
/etc/fixuid \
"/data" \
"/config" \
"/cache" \
&& chown -R "$USER_UID":"$USER_GID" \
"/data" \
"/config" \
"/cache" \
&& cat <<EOF > /etc/fixuid/config.yml
user: $USER
group: $existing_group
paths:
- /var/www
- /home/$USER
- /data
- /config
- /cache

EOF

FROM builder AS builder_nodejs

ARG TARGETARCH
Expand Down
45 changes: 45 additions & 0 deletions fpm/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ ARG XDEBUG_VERSION=3.5.1
# Latest version of pcov: https://packagist.org/packages/pecl/pcov
ARG PCOV_VERSION=1.0.12


RUN apt-get update \
&& apt-get install --assume-yes --no-install-recommends \
# Needed for xdebug extension configuration
Expand Down Expand Up @@ -186,6 +187,50 @@ RUN apt-get update \
&& rm -rf /var/lib/apt/lists/* \
&& rm -rf /tmp/*

# Latest version of fixuid: https://github.com/boxboat/fixuid/releases/latest
ARG FIXUID_VERSION=0.6.0

ARG USER=code
ARG GROUP=code
ARG USER_UID=1000
ARG USER_GID=1000
ARG TARGETARCH

SHELL ["/bin/bash", "-o", "pipefail", "-c"]

RUN curl -fsSLo /tmp/fixuid.tar.gz "https://github.com/boxboat/fixuid/releases/download/v$FIXUID_VERSION/fixuid-${FIXUID_VERSION}-linux-${TARGETARCH}.tar.gz" \
&& tar -xf /tmp/fixuid.tar.gz -C /usr/local/bin fixuid \
&& chown root:root /usr/local/bin/fixuid \
&& chmod 4755 /usr/local/bin/fixuid \
&& rm /tmp/fixuid.tar.gz \
# Create user and group, and setup fixuid configuration
&& existing_group="$(getent group "$USER_GID" | cut -d: -f1 || true)" \
&& if [ -z "$existing_group" ]; then \
groupadd --gid "$USER_GID" "$GROUP"; \
existing_group="$GROUP"; \
fi \
&& useradd --uid "$USER_UID" --gid "$USER_GID" --create-home "$USER" --shell /bin/bash \
&& mkdir -p \
/etc/fixuid \
"/data" \
"/config" \
"/cache" \
&& chown -R "$USER_UID":"$USER_GID" \
"/data" \
"/config" \
"/cache" \
&& cat <<EOF > /etc/fixuid/config.yml
user: $USER
group: $existing_group
paths:
- /var/www
- /home/$USER
- /data
- /config
- /cache

EOF

FROM builder AS builder_nodejs

ARG TARGETARCH
Expand Down
44 changes: 44 additions & 0 deletions frankenphp/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,50 @@ RUN apt-get update \
&& rm -rf /var/lib/apt/lists/* \
&& rm -rf /tmp/*

# Latest version of fixuid: https://github.com/boxboat/fixuid/releases/latest
ARG FIXUID_VERSION=0.6.0

ARG USER=code
ARG GROUP=code
ARG USER_UID=1000
ARG USER_GID=1000
ARG TARGETARCH

SHELL ["/bin/bash", "-o", "pipefail", "-c"]

RUN curl -fsSLo /tmp/fixuid.tar.gz "https://github.com/boxboat/fixuid/releases/download/v$FIXUID_VERSION/fixuid-${FIXUID_VERSION}-linux-${TARGETARCH}.tar.gz" \
&& tar -xf /tmp/fixuid.tar.gz -C /usr/local/bin fixuid \
&& chown root:root /usr/local/bin/fixuid \
&& chmod 4755 /usr/local/bin/fixuid \
&& rm /tmp/fixuid.tar.gz \
# Create user and group, and setup fixuid configuration
&& existing_group="$(getent group "$USER_GID" | cut -d: -f1 || true)" \
&& if [ -z "$existing_group" ]; then \
groupadd --gid "$USER_GID" "$GROUP"; \
existing_group="$GROUP"; \
fi \
&& useradd --uid "$USER_UID" --gid "$USER_GID" --create-home "$USER" --shell /bin/bash \
&& mkdir -p \
/etc/fixuid \
"/data" \
"/config" \
"/cache" \
&& chown -R "$USER_UID":"$USER_GID" \
"/data" \
"/config" \
"/cache" \
&& cat <<EOF > /etc/fixuid/config.yml
user: $USER
group: $existing_group
paths:
- /var/www
- /home/$USER
- /data
- /config
- /cache

EOF

FROM builder AS builder_nodejs

ARG TARGETARCH
Expand Down