Skip to content

Commit bd8e00e

Browse files
authored
Merge pull request #1 from skilld-labs/use-cmd
Use CMD instead of ENTRYPOINT
2 parents 771b165 + 2ed0616 commit bd8e00e

File tree

2 files changed

+32
-17
lines changed

2 files changed

+32
-17
lines changed

Dockerfile

Lines changed: 20 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,28 @@
11
FROM alpine:edge
2-
MAINTAINER Harry Walter
2+
33
MAINTAINER Andriy Yun <andriy.yun@gmail.com>
4+
MAINTAINER Andy Postnikov <apostnikov@gmail.com>
45

56
RUN echo "@testing http://dl-cdn.alpinelinux.org/alpine/edge/testing" >> /etc/apk/repositories \
6-
&& apk add --update php7@testing php7-xml@testing php7-phar@testing \
7-
php7-openssl@testing php7-mbstring@testing php7-json@testing php7-ctype@testing \
8-
curl patch \
9-
&& rm -fr /var/cache/apk/* \
10-
&& ln -s /usr/bin/php7 /usr/bin/php \
11-
&& curl -sS https://getcomposer.org/installer | php -- --filename=composer --install-dir=/usr/bin
12-
13-
RUN composer global require drupal/coder \
14-
&& ln -s /root/.composer/vendor/squizlabs/php_codesniffer/scripts/phpcs /usr/bin/phpcs \
15-
&& ln -s /root/.composer/vendor/squizlabs/php_codesniffer/scripts/phpcbf /usr/bin/phpcbf \
16-
&& ln -s /root/.composer/vendor/drupal/coder/coder_sniffer/Drupal /root/.composer/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Drupal
7+
&& apk add --no-cache \
8+
php7@testing \
9+
php7-xml@testing \
10+
php7-phar@testing \
11+
php7-openssl@testing \
12+
php7-mbstring@testing \
13+
php7-json@testing \
14+
php7-ctype@testing \
15+
curl \
16+
patch \
17+
&& ln -s /usr/bin/php7 /usr/bin/php \
18+
&& curl -sS https://getcomposer.org/installer | php -- --filename=composer --install-dir=/usr/bin \
19+
&& composer global require drupal/coder \
20+
&& ln -s /root/.composer/vendor/squizlabs/php_codesniffer/scripts/phpcs /usr/bin/phpcs \
21+
&& ln -s /root/.composer/vendor/squizlabs/php_codesniffer/scripts/phpcbf /usr/bin/phpcbf \
22+
&& ln -s /root/.composer/vendor/drupal/coder/coder_sniffer/Drupal /root/.composer/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Drupal \
23+
&& ln -s /root/.composer/vendor/drupal/coder/coder_sniffer/DrupalPractice /root/.composer/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/DrupalPractice
1724

1825
VOLUME /work
1926
WORKDIR /work
2027

21-
ENTRYPOINT ["phpcs", "--standard=Drupal"]
28+
CMD ["phpcs", "--standard=Drupal", "."]

README.md

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,24 @@
11
# docker-phpcs-drupal
22

33
## How to use
4-
Go to needed module or file
4+
Go to needed directory with code
55
```
66
cd /path/to/check
77
```
88
By default we call phpcs from container
99
```
10-
docker run --rm -v $(pwd):/work docker-phpcs-drupal ./
10+
docker run --rm -v $(pwd):/work skilldlabs/docker-phpcs-drupal
1111
```
1212

13-
To call phpcbf you need rewrite entrypoint directive
13+
To call phpcbf you need to override default command
1414
```
15-
docker run --rm -v $(pwd):/work --entrypoint=phpcbf docker-phpcs-drupal --standard=Drupal ./
15+
docker run --rm -v $(pwd):/work skilldlabs/docker-phpcs-drupal phpcbf --standard=Drupal .
1616
```
17+
18+
## Shortening of container name
19+
20+
```
21+
docker tag skilldlabs/docker-phpcs-drupal phpcs
22+
```
23+
24+
then you can use `docker run --rm -v $(pwd):/work phpcs`

0 commit comments

Comments
 (0)