-
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathContainerfile
More file actions
154 lines (143 loc) · 5.66 KB
/
Copy pathContainerfile
File metadata and controls
154 lines (143 loc) · 5.66 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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
# SPDX-FileCopyrightText: © 2026 Nfrastack <code@nfrastack.com>
#
# SPDX-License-Identifier: MIT
ARG \
BASE_IMAGE
FROM ${BASE_IMAGE}
LABEL \
org.opencontainers.image.title="Zerotier" \
org.opencontainers.image.description="Virtual ethernet switch and Administation Console" \
org.opencontainers.image.url="https://hub.docker.com/r/nfrastack/zerotier" \
org.opencontainers.image.documentation="https://github.com/nfrastack/container-zerotier/blob/main/README.md" \
org.opencontainers.image.source="https://github.com/nfrastack/container-zerotier.git" \
org.opencontainers.image.authors="Nfrastack <code@nfrastack.com>" \
org.opencontainers.image.vendor="Nfrastack <https://www.nfrastack.com>" \
org.opencontainers.image.licenses="MIT"
ARG \
ZEROTIER_VERSION="1.16.2" \
ZT_NET_VERSION="v0.8.3" \
ZEROTIER_REPO_URL=https://github.com/zerotier/ZeroTierOne \
ZT_NET_REPO_URL=https://github.com/sinamics/ztnet
COPY CHANGELOG.md /usr/src/container/CHANGELOG.md
COPY LICENSE /usr/src/container/LICENSE
COPY README.md /usr/src/container/README.md
ENV \
CONTAINER_ENABLE_MESSAGING=FALSE \
IMAGE_NAME="nfrastack/zerotier" \
IMAGE_REPO_URL="https://github.com/nfrastack/container-zerotier/"
COPY build-assets/ /build-assets
RUN echo "" && \
BUILD_ENV=" \
10-nginx/ENABLE_NGINX=FALSE \
10-nginx/NGINX_SITE_ENABLED=ztnet \
10-nginx/NGINX_SITE_ZTNET_MODE=proxy \
10-nginx/NGINX_SITE_ZTNET_PROXY_URL=[env:UI_PROTOCOL]://localhost:[env:UI_LISTEN_PORT] \
10-nginx/NGINX_SITE_ZTNET_HEADER_XFRAME_NAME=X-Frame-Options \
10-nginx/NGINX_SITE_ZTNET_HEADER_XFRAME_VALUE=SAMEORIGIN \
10-nginx/NGINX_SITE_ZTNET_HEADER_XROBOTS_NAME=X-Content-Type-Options \
10-nginx/NGINX_SITE_ZTNET_HEADER_XROBOTS_VALUE=nosniff \
10-nginx/NGINX_SITE_ZTNET_HEADER_XCONTENT_NAME=X-Content-Type-Options \
10-nginx/NGINX_SITE_ZTNET_HEADER_XCONTENT_VALUE=nosniff \
10-nginx/NGINX_SITE_ZTNET_HEADER_XSS_NAME=X-XSS-Protection \
10-nginx/NGINX_SITE_ZTNET_HEADER_XSS_VALUE=1; mode=block \
" \
&& \
ZEROTIER_BUILD_DEPS_ALPINE=" \
binutils \
build-base \
git \
linux-headers \
" \
&& \
ZEROTIER_RUN_DEPS_ALPINE=" \
iptables \
libc6-compat \
libstdc++ \
" \
&& \
ZT_NET_BUILD_DEPS_ALPINE=" \
zip \
" \
&& \
ZT_NET_RUN_DEPS_ALPINE=" \
moreutils \
nodejs \
npm \
postgresql-client \
" \
&& \
source /container/base/functions/container/build && \
container_build_log image && \
create_user zerotier 9376 zerotier 9376 /dev/null && \
package update && \
package upgrade && \
package install \
ZEROTIER_BUILD_DEPS \
ZEROTIER_RUN_DEPS \
ZT_NET_BUILD_DEPS \
ZT_NET_RUN_DEPS \
&& \
package build go buildtime && \
\
clone_git_repo "${ZEROTIER_REPO_URL}" "${ZEROTIER_VERSION}" /usr/src/zerotier && \
build_assets src /build-assets/zerotier/src "${GIT_REPO_SRC_ZEROTIER}" && \
build_assets scripts /build-assets/zerotier/scripts && \
\
cd /usr/src/zerotier && \
sed -i "s|ZT_SSO_SUPPORTED=1|ZT_SSO_SUPPORTED=0|g" make-linux.mk && \
make -j $(nproc) -f make-linux.mk ZT_NONFREE=1 ZT_CONTROLLER=0 && \
make install && \
rm -rf /var/lib/zerotier-one && \
container_build_log add "Zerotier" "${ZEROTIER_VERSION}" "${ZEROTIER_REPO_URL}" && \
\
clone_git_repo "${ZT_NET_REPO_URL}" "${ZT_NET_VERSION}" /usr/src/ztnet && \
build_assets src /build-assets/zt-net/src /usr/src/ztnet && \
build_assets scripts /build-assets/zt-net/scripts && \
cd /usr/src/ztnet/ztnodeid && \
go mod tidy && \
go build -ldflags='-s -w' -trimpath -o /usr/local/bin/ztmkworld cmd/mkworld/main.go && \
cd /usr/src/ztnet && \
npm install \
@prisma/client@6.19.3 \
@paralleldrive/cuid2 \
&& \
npm install -g \
prisma@6.19.3 \
ts-node \
&& \
npx prisma generate && \
npm ci && \
SKIP_ENV_VALIDATION=1 npm run build:webpack && \
mkdir -p /app/.next && \
cp next.config.mjs package.json /app/ && \
cp -R \
public \
prisma \
/app/ && \
cp -R \
.next/server \
.next/static \
/app/.next/ && \
cp -R \
.next/standalone/. \
/app/ && \
cp -R \
.next/BUILD* \
.next/*.json \
/app/.next/ && \
cd /app && \
rm -rf node_modules && \
npm install --production && \
npm install daisyui@^4.12.24 && \
container_build_log add "ZT Net" "${ZT_NET_VERSION}" "${ZT_NET_REPO_URL}" && \
echo "${ZT_NET_VERSION}" > /app/.ztnet-version && \
chown -R zerotier:zerotier /app && \
\
package remove \
ZEROTIER_BUILD_DEPS \
ZT_NET_BUILD_DEPS \
&& \
package cleanup
EXPOSE 3000
EXPOSE 9993/udp
COPY rootfs /