-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
49 lines (36 loc) · 1.24 KB
/
Dockerfile
File metadata and controls
49 lines (36 loc) · 1.24 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
37
38
39
40
41
42
43
44
45
46
47
48
49
# Set defaults
ARG BASE_IMAGE="node:8-alpine"
ARG NPM_NAME="eslint"
ARG PHPQA_NAME="eslint"
ARG VERSION="5.0.1"
# Build image
FROM ${BASE_IMAGE}
ARG NPM_NAME
ARG VERSION
ARG PHPQA_NAME
ARG VERSION
ARG BUILD_DATE
ARG VCS_REF
ARG IMAGE_NAME
# Install Tini - https://github.com/krallin/tini
RUN apk add --no-cache tini
# Install eslint - https://github.com/eslint/eslint
RUN npm install --global ${NPM_NAME} && npm cache clear --force
# Add entrypoint script
COPY ./docker-entrypoint.sh /docker-entrypoint.sh
RUN chmod +x /docker-entrypoint.sh
# Add image labels
LABEL org.label-schema.schema-version="1.0" \
org.label-schema.vendor="phpqa" \
org.label-schema.name="${PHPQA_NAME}" \
org.label-schema.version="${VERSION}" \
org.label-schema.build-date="${BUILD_DATE}" \
org.label-schema.url="https://github.com/phpqa/${PHPQA_NAME}" \
org.label-schema.usage="https://github.com/phpqa/${PHPQA_NAME}/README.md" \
org.label-schema.vcs-url="https://github.com/phpqa/${PHPQA_NAME}.git" \
org.label-schema.vcs-ref="${VCS_REF}" \
org.label-schema.docker.cmd="docker run --rm --volume \${PWD}:/app --workdir /app ${IMAGE_NAME}"
# Package container
WORKDIR "/app"
ENTRYPOINT ["/docker-entrypoint.sh"]
CMD ["eslint"]