-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathDockerfile
39 lines (30 loc) · 1.09 KB
/
Dockerfile
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
ARG LDFLAGS CODENAME
FROM registry.drycc.cc/drycc/go-dev:latest AS build
ADD . /workspace
RUN export GO111MODULE=on \
&& cd /workspace \
&& CGO_ENABLED=0 init-stack go build -ldflags "${LDFLAGS}" -o /usr/local/bin/boot boot.go
FROM registry.drycc.cc/drycc/base:${CODENAME}
ENV DRYCC_UID=1001 \
DRYCC_GID=1001 \
DRYCC_HOME_DIR=/workspace \
MC_VERSION="2023.06.15.15.08.26" \
JQ_VERSION="1.6"
RUN groupadd drycc --gid ${DRYCC_GID} \
&& useradd drycc -u ${DRYCC_UID} -g ${DRYCC_GID} -s /bin/bash -m -d ${DRYCC_HOME_DIR}
COPY rootfs/bin /bin/
COPY rootfs/etc/ssh /etc/ssh/
COPY rootfs/container-entrypoint.sh /container-entrypoint.sh
COPY --from=build /usr/local/bin/boot /usr/bin/boot
RUN install-packages git openssh-server coreutils xz-utils tar \
&& install-stack mc $MC_VERSION \
&& install-stack jq $JQ_VERSION \
&& mkdir -p /var/run/sshd \
&& rm -rf /etc/ssh/ssh_host* \
&& chmod +x /bin/create_bucket /container-entrypoint.sh
USER ${DRYCC_UID}
WORKDIR ${DRYCC_HOME_DIR}
ENTRYPOINT ["init-stack", "/container-entrypoint.sh"]
CMD ["/usr/bin/boot", "server"]
EXPOSE 2223
EXPOSE 3000