aboutsummaryrefslogtreecommitdiff
path: root/Dockerfile
blob: ec7abf5c127730c43f7a027ac8dd9a5cf1ec3199 (plain)
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
53
54
55
FROM debian:bullseye-slim AS build-stage

COPY . /tmp/clog

ARG KORE_VERSION=4.3.0-rc2
ARG KORE_SHA256=e9e3c9faa02b6c9c81da4d98ac4b99e4b874c41ac642b2f2a6b087f998d3cf62

RUN set -e \
	&& apt-get update -qq \
	&& apt-get upgrade -y \
	&& apt-get install -y \
		curl \
		gcc \
		make \
		pkg-config \
		libssl-dev \
		libpq-dev \
	&& cd /tmp \
	&& curl "https://kore.io/releases/kore-${KORE_VERSION}.tar.gz" --output "kore-${KORE_VERSION}.tar.gz" \
	&& echo "${KORE_SHA256}  kore-${KORE_VERSION}.tar.gz" > "kore-${KORE_VERSION}.tar.gz.sha256" \
	&& sha256sum -c "kore-${KORE_VERSION}.tar.gz.sha256" \
	&& tar xf "kore-${KORE_VERSION}.tar.gz" \
	&& cd "kore-${KORE_VERSION}" \
	&& make \
	&& make install \
	&& cd /tmp/clog \
	&& make fetch-dependencies \
	&& kodev build

FROM debian:bullseye-slim

LABEL maintainer="Michael McVady <femtonaut@gmail.com>"

RUN set -e \
	&& mkdir -p /var/chroot \
	&& addgroup --gid 502 clog \
	&& adduser --disabled-password --uid 502 --home /var/chroot/clog --shell /sbin/nologin --ingroup clog --gecos "" clog \
	&& mkdir -p /var/chroot/clog/etc \
	&& mkdir -p /var/chroot/clog/lib/x86_64-linux-gnu \
	&& cp /lib/x86_64-linux-gnu/libnss_dns.so.2 /var/chroot/clog/lib/x86_64-linux-gnu/libnss_dns.so.2 \
	&& apt-get update -qq \
	&& apt-get upgrade -y \
	&& apt-get install -y \
		libssl-dev \
		libpq-dev \
	&& rm -rf /var/lib/apt/lists/*

COPY --from=build-stage /tmp/clog/assets /var/chroot/clog/assets/
COPY --from=build-stage /tmp/clog/clog /tmp/clog/run.sh /var/chroot/clog/

EXPOSE 8888
STOPSIGNAL SIGQUIT

WORKDIR /var/chroot/clog
ENTRYPOINT [ "./run.sh" ]