Skip to content

Commit 260038c

Browse files
Sergey-Orlovandypost
authored andcommitted
Update Dockerfile
1 parent eb51fe8 commit 260038c

File tree

2 files changed

+73
-0
lines changed

2 files changed

+73
-0
lines changed

Makefile

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
NAME = skilldlabs/docker-phpcs-drupal
2+
TAGS ?= 10
3+
4+
DOCKER_BUILDKIT ?= 1
5+
6+
.PHONY: all build push
7+
8+
all: build push
9+
10+
build:
11+
@echo "Building images for tags: $(TAGS)"
12+
set -e; for i in $(TAGS); do printf "\nBuilding $(NAME):$$i \n\n"; cd drupal$$i; \
13+
DOCKER_BUILDKIT=$(DOCKER_BUILDKIT) docker build -t $(NAME):$$i \
14+
--no-cache --progress=plain \
15+
--build-arg BUILD_DATE=`date -u +"%Y-%m-%dT%H:%M:%SZ"` \
16+
--build-arg VCS_REF=`git rev-parse --short HEAD` .; \
17+
cd ..; done
18+
19+
push:
20+
@echo "Pushing images for tags: $(TAGS)"
21+
set -e; for i in $(TAGS); do printf "\nPushing $(NAME):$$i \n\n"; docker push $(NAME):$$i; done

drupal10/Dockerfile

+52
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
FROM alpine:3.20
2+
3+
ARG BUILD_DATE
4+
ARG VCS_REF
5+
6+
LABEL org.label-schema.build-date=$BUILD_DATE \
7+
org.label-schema.vcs-ref=$VCS_REF \
8+
org.label-schema.schema-version="1.0" \
9+
org.label-schema.name="docker-phpcs-drupal" \
10+
org.label-schema.description="PHP codesniffer for Drupal - phpcs & phpcbf" \
11+
org.label-schema.vcs-url="https://github.com/skilld-labs/docker-phpcs-drupal" \
12+
maintainer="Andriy Yun , Andy Postnikov , Sergey Orlov"
13+
14+
RUN set -e \
15+
&& apk add --no-cache \
16+
curl \
17+
git \
18+
patch \
19+
php83 \
20+
php83-apcu \
21+
php83-ctype \
22+
php83-json \
23+
php83-mbstring \
24+
php83-opcache \
25+
php83-openssl \
26+
php83-phar \
27+
php83-simplexml \
28+
php83-tokenizer \
29+
php83-xmlwriter \
30+
php83-zlib;
31+
32+
RUN ln -s $(which php8) /usr/local/bin/php \
33+
&& curl -sS https://getcomposer.org/installer | php -- --filename=composer --install-dir=/usr/bin \
34+
&& composer global config --no-plugins allow-plugins.dealerdirect/phpcodesniffer-composer-installer true \
35+
&& composer global require drupal/coder --update-no-dev --no-suggest --prefer-dist ^8.3 \
36+
&& composer global require squizlabs/php_codesniffer \
37+
&& ln -s /root/.composer/vendor/bin/phpcs /usr/bin/phpcs \
38+
&& ln -s /root/.composer/vendor/bin/phpcbf /usr/bin/phpcbf \
39+
# Clone coder sniffs into the codesniffer sniffs directory.
40+
&& ln -s /root/.composer/vendor/drupal/coder/coder_sniffer/Drupal /root/.composer/vendor/squizlabs/php_codesniffer/src/Standards/Drupal \
41+
&& ln -s /root/.composer/vendor/drupal/coder/coder_sniffer/DrupalPractice /root/.composer/vendor/squizlabs/php_codesniffer/src/Standards/DrupalPractice \
42+
# Removing packages which needed only during the installation.
43+
&& apk del --no-cache git \
44+
# Clear composer cache - it will just take space.
45+
&& rm -rf /root/.composer/cache/* \
46+
# Sniffs could take much time, we will set unlimited time for PHP execution
47+
&& sed -i "s/.*memory_limit = .*/memory_limit = -1/" /etc/php83/php.ini
48+
49+
VOLUME /work
50+
WORKDIR /work
51+
52+
CMD ["phpcs", "--standard=Drupal,DrupalPractice", "."]

0 commit comments

Comments
 (0)