Skip to content

Commit

Permalink
add labels on Docker image (see https://github.com/opencontainers/ima…
Browse files Browse the repository at this point in the history
  • Loading branch information
llaville committed Oct 31, 2024
1 parent 584063a commit 45f80e6
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,19 @@ ARG PHP_VERSION=8.3

FROM php:${PHP_VERSION}-cli-alpine

ARG PACKAGE_CONSTRAINT=9.5.x-dev

# https://github.com/opencontainers/image-spec/blob/main/annotations.md

LABEL org.opencontainers.image.title="overtrue/phplint"
LABEL org.opencontainers.image.description="Docker image of overtrue/phplint Composer package"
LABEL org.opencontainers.image.source="https://github.com/overtrue/phplint"
LABEL org.opencontainers.image.licenses="MIT"
LABEL org.opencontainers.image.authors="overtrue,llaville"

COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
RUN cp /usr/local/etc/php/php.ini-development /usr/local/etc/php/php.ini
RUN chmod +x /entrypoint.sh \
&& cp /usr/local/etc/php/php.ini-development /usr/local/etc/php/php.ini

# Default container directory where to mount your project source files
# GitLab uses $CI_PROJECT_DIR to identify where job runs on source files
Expand All @@ -18,10 +28,10 @@ RUN addgroup appgroup && adduser appuser -D -G appgroup
# Tell docker that all future commands should run as the appuser user
USER appuser

# Install Composer v2 then overtrue/phplint package
# Install Composer v2 binary then package
COPY --from=composer/composer:2-bin /composer /usr/bin/composer
ENV COMPOSER_ALLOW_SUPERUSER 1
RUN composer global require --no-progress overtrue/phplint 9.5.x-dev
RUN composer global require --no-progress overtrue/phplint $PACKAGE_CONSTRAINT

# Following recommendation at https://docs.github.com/en/actions/creating-actions/dockerfile-support-for-github-actions#workdir

Expand Down

0 comments on commit 45f80e6

Please sign in to comment.