Skip to content

Commit bfb0382

Browse files
committed
docker: add webui.
1 parent 891a596 commit bfb0382

File tree

1 file changed

+19
-12
lines changed

1 file changed

+19
-12
lines changed

Dockerfile

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,17 @@ FROM ubuntu:latest AS smartdns-builder
22
LABEL previous-stage=smartdns-builder
33

44
# prepare builder
5-
ARG OPENSSL_VER=3.4.1
5+
ARG OPENSSL_VER=3.4.2
66
RUN apt update && \
7-
apt install -y binutils perl curl make musl-tools musl-dev && \
8-
ln -s /usr/include/linux /usr/include/$(uname -m)-linux-musl && \
9-
ln -s /usr/include/asm-generic /usr/include/$(uname -m)-linux-musl && \
10-
ln -s /usr/include/$(uname -m)-linux-gnu/asm /usr/include/$(uname -m)-linux-musl && \
7+
apt install -y binutils perl curl make gcc nodejs npm clang wget unzip ca-certificates && \
8+
update-ca-certificates && \
9+
\
10+
curl https://sh.rustup.rs -sSf | sh -s -- -y && \
11+
export PATH="$HOME/.cargo/bin:$PATH" && \
1112
\
1213
mkdir -p /build/openssl && \
1314
cd /build/openssl && \
14-
curl -sSL https://github.com/openssl/openssl/releases/download/openssl-${OPENSSL_VER}/openssl-${OPENSSL_VER}.tar.gz | tar --strip-components=1 -zxv && \
15+
curl -sSL https://www.github.com/openssl/openssl/releases/download/openssl-${OPENSSL_VER}/openssl-${OPENSSL_VER}.tar.gz | tar --strip-components=1 -zxv && \
1516
\
1617
OPENSSL_OPTIONS="no-argon2 no-aria no-async no-bf no-blake2 no-camellia no-cmp no-cms " \
1718
OPENSSL_OPTIONS="$OPENSSL_OPTIONS no-comp no-des no-dh no-dsa no-ec2m no-engine no-gost "\
@@ -20,33 +21,39 @@ RUN apt update && \
2021
OPENSSL_OPTIONS="$OPENSSL_OPTIONS no-scrypt no-seed no-siphash no-siv no-sm2 no-sm3 no-sm4 "\
2122
OPENSSL_OPTIONS="$OPENSSL_OPTIONS no-srp no-srtp no-ts no-whirlpool no-apps no-ssl-trace "\
2223
OPENSSL_OPTIONS="$OPENSSL_OPTIONS no-ssl no-ssl3 no-tests -Os" \
23-
export CC=musl-gcc && \
24+
cd /build/openssl && \
2425
if [ "$(uname -m)" = "aarch64" ]; then \
2526
./config --prefix=/opt/build $OPENSSL_OPTIONS -mno-outline-atomics ; \
2627
else \
2728
./config --prefix=/opt/build $OPENSSL_OPTIONS ; \
2829
fi && \
30+
mkdir -p /opt/build/lib /opt/build/lib64 && \
2931
make all -j8 && make install_sw && \
3032
cd / && rm -rf /build
3133

3234
# do make
3335
COPY . /build/smartdns/
3436
RUN cd /build/smartdns && \
35-
export CC=musl-gcc && \
3637
export CFLAGS="-I /opt/build/include" && \
3738
export LDFLAGS="-L /opt/build/lib -L /opt/build/lib64" && \
38-
sh ./package/build-pkg.sh --platform linux --arch `dpkg --print-architecture` --static && \
39+
export PATH="$HOME/.cargo/bin:$PATH" && \
40+
rm -fr /build/smartdns/package/*.tar.gz && \
41+
sh ./package/build-pkg.sh --platform linux --arch `dpkg --print-architecture` --with-ui --static && \
3942
\
4043
( cd package && tar -xvf *.tar.gz && chmod a+x smartdns/etc/init.d/smartdns ) && \
4144
\
42-
mkdir -p /release/var/log /release/run && \
45+
mkdir -p /release/var/log /release/run /release/var/lib/smartdns && \
4346
cp package/smartdns/etc /release/ -a && \
4447
cp package/smartdns/usr /release/ -a && \
48+
rm -f /release/usr/local/smartdns/lib/libssl* && \
49+
rm -f /release/usr/local/smartdns/lib/libcrypto* && \
50+
cp /opt/build/lib/lib*.so* /release/usr/local/lib/smartdns/lib/ -a 2>/dev/null || true && \
51+
cp /opt/build/lib64/lib*.so* /release/usr/local/lib/smartdns/lib/ -a 2>/dev/null || true && \
4552
cd / && rm -rf /build
4653

4754
FROM busybox:stable-musl
4855
COPY --from=smartdns-builder /release/ /
49-
EXPOSE 53/udp
50-
VOLUME ["/etc/smartdns/"]
56+
EXPOSE 53/udp 6080/tcp
57+
VOLUME ["/etc/smartdns/", "/var/lib/smartdns/"]
5158

5259
CMD ["/usr/sbin/smartdns", "-f", "-x"]

0 commit comments

Comments
 (0)