-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
52 lines (40 loc) · 1.8 KB
/
Dockerfile
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
50
51
52
# syntax = docker/dockerfile:1
FROM registry.dev.kununu.it/core/publish/ubuntu:18.04 AS base-image
FROM base-image AS builder-output
ARG nodejs_major_version=10 \
nodejs_minor_version=24.1 \
code_dir=/code \
BUILDARCH
ENV PATH=$PATH:${code_dir}/node_modules/.bin
RUN apt update && apt install --no-install-recommends -y \
# npm needs ca-certificates
wget ca-certificates && \
wget -O nodejs.deb https://deb.nodesource.com/node_${nodejs_major_version}.x/pool/main/n/nodejs/nodejs_${nodejs_major_version}.${nodejs_minor_version}-deb-1nodesource1_${BUILDARCH}.deb && \
#wget -O nodejs.deb -q https://deb.nodesource.com/node_${nodejs_major_version}.x/pool/main/n/nodejs/nodejs_${nodejs_major_version}.${nodejs_minor_version}-deb-1nodesource1_${BUILDARCH}.deb && \
apt install -y ./nodejs.deb && \
rm nodejs.deb && \
mkdir -p /output/usr/local/bin && \
rm -rf /var/lib/apt/lists/*
WORKDIR $code_dir
# For some reason:
# COPY . $code_dir
# Results in the layer _always_ being invalidated
COPY . /code
RUN npm install && \
pkg . --output=/output/usr/local/bin/phraseapp-cli -t host
##
## Our completed image
##
FROM base-image
# Our non-volatile labels
LABEL org.opencontainers.image.documentation="https://github.com/kununu/phraseapp-cli" \
org.opencontainers.image.source="ssh://[email protected]:kununu/phraseapp-cli" \
org.opencontainers.image.version="2.4.4" \
org.opencontainers.image.description="An ancient tool to contact phraseapp." \
docker.cmd="docker run -it registry.dev.kununu.it/core/publish/phraseapp-cli:latest --version" \
docker.cmd.devel="TODO"
ENTRYPOINT [ "/usr/local/bin/phraseapp-cli" ]
COPY --from=builder-output /output /
# Our mutable labels
ARG source_commit="dirty"
LABEL "org.opencontainers.image.revision"="${source_commit}"