Repository navigation
Expand file tree
/
Copy pathDockerfile
More file actions
67 lines (57 loc) · 1.81 KB
/
Copy pathDockerfile
File metadata and controls
67 lines (57 loc) · 1.81 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# Stage 1
FROM alpine:3.15 AS builder
RUN apk add --no-cache git build-base libev-dev cmake argp-standalone && \
mkdir -p /source/build
ARG SOURCE=https://github.com/zhc105/Liteflow.git
ARG BRANCH=master
WORKDIR /source
# COPY cannot access external directory beyond the build context.
# ARG cannot be used in COPY or other build phase commands.
COPY . /tmp/Liteflow/
RUN case "${SOURCE}" in \
https://*|http://*|git@*) \
echo "Cloning repository ${SOURCE}, branch ${BRANCH}"; \
git clone --branch ${BRANCH} --recursive ${SOURCE} /source/Liteflow ;; \
local|.|./) \
echo "Copying local source folder"; \
mv /tmp/Liteflow /source/Liteflow ;; \
*) \
echo "Specify a valid Git URL or \"local\" or \".\"or \"./\" for SOURCE argument."; \
exit 1 ;; \
esac
WORKDIR /source/Liteflow
RUN ls -l /source/Liteflow && git submodule update --init --recursive && \
mkdir -p build && \
cd build && \
cmake -DCMAKE_C_FLAGS="-O2 -g" .. && \
make
# Stage 2
FROM alpine:3.15
RUN apk add --no-cache bash libev psmisc && \
mkdir -p /app
ENV tag="main" \
confpath="" \
perf_log="0" \
max_incoming_peers="10" \
connect_peers="" \
prefer_ipv6="0" \
node_id="9999" \
password="password" \
listen_addr="0.0.0.0" \
listen_port="1901" \
transmit_rate_init="102400" \
transmit_rate_max="104857600" \
transmit_rate_min="10240" \
fec_decode="0" \
fec_group_size="0" \
mtu="1428" \
entrance_rules="" \
forward_rules=""
RUN mkdir -p /app/bin && \
mkdir -p /app/etc
WORKDIR /app
COPY --from=builder /source/Liteflow/build/src/liteflow /app/bin
COPY docker/liteflow.conf.template /app/etc
COPY docker/docker-start.sh /app
RUN chmod +x /app/docker-start.sh
CMD ["./docker-start.sh"]