-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathDockerfile
More file actions
36 lines (30 loc) · 1 KB
/
Dockerfile
File metadata and controls
36 lines (30 loc) · 1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
ARG PHP
FROM php:7.3 as builder
# Install build dependencies
RUN set -eux \
&& DEBIAN_FRONTEND=noninteractive apt-get update -qq \
&& DEBIAN_FRONTEND=noninteractive apt-get install -qq -y --no-install-recommends --no-install-suggests \
ca-certificates \
curl \
git \
&& git clone https://github.com/squizlabs/PHP_CodeSniffer
ARG PHPCBF
RUN set -eux \
&& cd PHP_CodeSniffer \
&& if [ "${PHPCBF}" = "latest" ]; then \
VERSION="$( git describe --abbrev=0 --tags )"; \
else \
VERSION="$( git tag | grep -E "^v?${PHPCBF}\.[.0-9]+\$" | sort -V | tail -1 )"; \
fi \
&& curl -sS -L https://github.com/squizlabs/PHP_CodeSniffer/releases/download/${VERSION}/phpcbf.phar -o /phpcbf.phar \
&& chmod +x /phpcbf.phar \
&& mv /phpcbf.phar /usr/bin/phpcbf
FROM php:${PHP} as production
LABEL \
maintainer="cytopia <[email protected]>" \
repo="https://github.com/cytopia/docker-phpcbf"
COPY --from=builder /usr/bin/phpcbf /usr/bin/phpcbf
ENV WORKDIR /data
WORKDIR /data
ENTRYPOINT ["phpcbf"]
CMD ["--version"]