mirror of
https://github.com/rustdesk/rustdesk-server.git
synced 2024-11-24 04:12:34 +08:00
Merge pull request #40 from paspo/new-dockerfile
test new Dockerfile with s6-overlay
This commit is contained in:
commit
c87e7bc848
34
docker/Dockerfile
Executable file
34
docker/Dockerfile
Executable file
@ -0,0 +1,34 @@
|
||||
FROM rust:alpine AS builder
|
||||
|
||||
RUN \
|
||||
apk -U add musl-dev git file make && \
|
||||
git clone --depth=1 https://github.com/rustdesk/rustdesk-server.git /src && \
|
||||
cd /src && \
|
||||
cargo build -r --manifest-path /src/Cargo.toml
|
||||
|
||||
FROM busybox:stable
|
||||
|
||||
ARG S6_OVERLAY_VERSION=3.1.0.1
|
||||
ADD https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}/s6-overlay-noarch.tar.xz /tmp
|
||||
ADD https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}/s6-overlay-x86_64.tar.xz /tmp
|
||||
RUN \
|
||||
tar -C / -Jxpf /tmp/s6-overlay-noarch.tar.xz && \
|
||||
tar -C / -Jxpf /tmp/s6-overlay-x86_64.tar.xz && \
|
||||
rm /tmp/s6-overlay*.tar.xz
|
||||
|
||||
COPY rootfs /
|
||||
COPY --from=builder /src/target/release/hbbr /usr/bin/hbbr
|
||||
COPY --from=builder /src/target/release/hbbs /usr/bin/hbbs
|
||||
COPY healthcheck.sh /usr/bin/healthcheck.sh
|
||||
|
||||
ENV RELAY relay.example.com
|
||||
|
||||
EXPOSE 21115 21116 21116/udp 21117 21118 21119
|
||||
|
||||
HEALTHCHECK --interval=10s --timeout=5s CMD /usr/bin/healthcheck.sh
|
||||
|
||||
WORKDIR /data
|
||||
|
||||
VOLUME /data
|
||||
|
||||
ENTRYPOINT ["/init"]
|
4
docker/healthcheck.sh
Executable file
4
docker/healthcheck.sh
Executable file
@ -0,0 +1,4 @@
|
||||
#!/bin/sh
|
||||
|
||||
/package/admin/s6/command/s6-svstat /run/s6-rc/servicedirs/hbbr || exit 1
|
||||
/package/admin/s6/command/s6-svstat /run/s6-rc/servicedirs/hbbs || exit 1
|
3
docker/rootfs/etc/s6-overlay/s6-rc.d/hbbr/run
Executable file
3
docker/rootfs/etc/s6-overlay/s6-rc.d/hbbr/run
Executable file
@ -0,0 +1,3 @@
|
||||
#!/command/execlineb -P
|
||||
posix-cd /data
|
||||
/usr/bin/hbbr
|
1
docker/rootfs/etc/s6-overlay/s6-rc.d/hbbr/type
Executable file
1
docker/rootfs/etc/s6-overlay/s6-rc.d/hbbr/type
Executable file
@ -0,0 +1 @@
|
||||
longrun
|
3
docker/rootfs/etc/s6-overlay/s6-rc.d/hbbs/run
Executable file
3
docker/rootfs/etc/s6-overlay/s6-rc.d/hbbs/run
Executable file
@ -0,0 +1,3 @@
|
||||
#!/command/execlineb -P
|
||||
posix-cd /data
|
||||
/usr/bin/hbbs -r $RELAY
|
1
docker/rootfs/etc/s6-overlay/s6-rc.d/hbbs/type
Executable file
1
docker/rootfs/etc/s6-overlay/s6-rc.d/hbbs/type
Executable file
@ -0,0 +1 @@
|
||||
longrun
|
0
docker/rootfs/etc/s6-overlay/s6-rc.d/user/contents.d/hbbr
Executable file
0
docker/rootfs/etc/s6-overlay/s6-rc.d/user/contents.d/hbbr
Executable file
0
docker/rootfs/etc/s6-overlay/s6-rc.d/user/contents.d/hbbs
Executable file
0
docker/rootfs/etc/s6-overlay/s6-rc.d/user/contents.d/hbbs
Executable file
Loading…
Reference in New Issue
Block a user