Spaces:
Build error
Build error
accplan
commited on
Commit
·
82f96f7
1
Parent(s):
228c247
test
Browse files- Dockerfile +72 -30
- Dockerfile_new → Dockerfile_old +17 -7
Dockerfile
CHANGED
@@ -1,34 +1,76 @@
|
|
1 |
-
FROM alpine:latest
|
2 |
-
LABEL maintainer="victorych"
|
3 |
-
RUN apk add --update --no-cache openssh
|
4 |
-
RUN echo 'ListenAddress 0.0.0.0' >> /etc/ssh/sshd_config
|
5 |
-
RUN echo 'Port 7860' >> /etc/ssh/sshd_config
|
6 |
-
RUN echo 'PasswordAuthentication yes' >> /etc/ssh/sshd_config
|
7 |
-
RUN echo 'PermitRootLogin yes' >> /etc/ssh/sshd_config
|
8 |
-
RUN echo 'PubkeyAuthentication yes' >> /etc/ssh/sshd_config
|
9 |
-
RUN echo 'AllowTcpForwarding yes' >> /etc/ssh/sshd_config
|
10 |
-
RUN echo 'PermitTunnel yes' >> /etc/ssh/sshd_config
|
11 |
-
RUN echo 'GatewayPorts yes' >> /etc/ssh/sshd_config
|
12 |
-
RUN echo 'PidFile /home/user/ssh.pid' >> /etc/ssh/sshd_config
|
13 |
-
|
14 |
-
RUN cat /etc/ssh/sshd_config
|
15 |
-
|
16 |
-
RUN adduser -h /home/user -s /bin/sh -D user
|
17 |
-
RUN echo -n 'user:test' | chpasswd
|
18 |
-
USER user
|
19 |
-
ENV HOME=/home/user \
|
20 |
-
PATH=/home/user/.local/bin:$PATH
|
21 |
-
|
22 |
-
RUN mkdir $HOME/app
|
23 |
-
|
24 |
-
WORKDIR $HOME/app
|
25 |
-
|
26 |
EXPOSE 7860
|
27 |
|
28 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
29 |
|
30 |
-
|
|
|
31 |
|
32 |
-
|
33 |
-
|
34 |
-
# -D
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
EXPOSE 7860
|
2 |
|
3 |
+
# setup build arguments for version of dependencies to use
|
4 |
+
ARG DOCKER_GEN_VERSION=0.10.3
|
5 |
+
ARG FOREGO_VERSION=v0.17.0
|
6 |
+
|
7 |
+
# Use a specific version of golang to build both binaries
|
8 |
+
FROM golang:1.20.3 as gobuilder
|
9 |
+
|
10 |
+
# Build docker-gen from scratch
|
11 |
+
FROM gobuilder as dockergen
|
12 |
+
|
13 |
+
ARG DOCKER_GEN_VERSION
|
14 |
+
|
15 |
+
RUN git clone https://github.com/nginx-proxy/docker-gen \
|
16 |
+
&& cd /go/docker-gen \
|
17 |
+
&& git -c advice.detachedHead=false checkout $DOCKER_GEN_VERSION \
|
18 |
+
&& go mod download \
|
19 |
+
&& CGO_ENABLED=0 GOOS=linux go build -ldflags "-X main.buildVersion=${DOCKER_GEN_VERSION}" ./cmd/docker-gen \
|
20 |
+
&& go clean -cache \
|
21 |
+
&& mv docker-gen /usr/local/bin/ \
|
22 |
+
&& cd - \
|
23 |
+
&& rm -rf /go/docker-gen
|
24 |
+
|
25 |
+
# Build forego from scratch
|
26 |
+
FROM gobuilder as forego
|
27 |
+
|
28 |
+
ARG FOREGO_VERSION
|
29 |
+
|
30 |
+
RUN git clone https://github.com/nginx-proxy/forego/ \
|
31 |
+
&& cd /go/forego \
|
32 |
+
&& git -c advice.detachedHead=false checkout $FOREGO_VERSION \
|
33 |
+
&& go mod download \
|
34 |
+
&& CGO_ENABLED=0 GOOS=linux go build -o forego . \
|
35 |
+
&& go clean -cache \
|
36 |
+
&& mv forego /usr/local/bin/ \
|
37 |
+
&& cd - \
|
38 |
+
&& rm -rf /go/forego
|
39 |
+
|
40 |
+
# Build the final image
|
41 |
+
FROM nginx:1.23.4
|
42 |
+
|
43 |
+
ARG NGINX_PROXY_VERSION
|
44 |
+
# Add DOCKER_GEN_VERSION environment variable
|
45 |
+
# Because some external projects rely on it
|
46 |
+
ARG DOCKER_GEN_VERSION
|
47 |
+
ENV NGINX_PROXY_VERSION=${NGINX_PROXY_VERSION} \
|
48 |
+
DOCKER_GEN_VERSION=${DOCKER_GEN_VERSION} \
|
49 |
+
DOCKER_HOST=unix:///tmp/docker.sock
|
50 |
+
|
51 |
+
# Install wget and install/updates certificates
|
52 |
+
RUN apt-get update \
|
53 |
+
&& apt-get install -y -q --no-install-recommends \
|
54 |
+
ca-certificates \
|
55 |
+
wget \
|
56 |
+
&& apt-get clean \
|
57 |
+
&& rm -r /var/lib/apt/lists/*
|
58 |
+
|
59 |
+
|
60 |
+
# Configure Nginx
|
61 |
+
RUN echo "daemon off;" >> /etc/nginx/nginx.conf \
|
62 |
+
&& sed -i 's/worker_processes 1/worker_processes auto/' /etc/nginx/nginx.conf \
|
63 |
+
&& sed -i 's/worker_connections 1024/worker_connections 10240/' /etc/nginx/nginx.conf \
|
64 |
+
&& mkdir -p '/etc/nginx/dhparam'
|
65 |
+
|
66 |
+
# Install Forego + docker-gen
|
67 |
+
COPY --from=forego /usr/local/bin/forego /usr/local/bin/forego
|
68 |
+
COPY --from=dockergen /usr/local/bin/docker-gen /usr/local/bin/docker-gen
|
69 |
+
|
70 |
+
COPY network_internal.conf /etc/nginx/
|
71 |
|
72 |
+
COPY app nginx.tmpl LICENSE /app/
|
73 |
+
WORKDIR /app/
|
74 |
|
75 |
+
ENTRYPOINT ["/app/docker-entrypoint.sh"]
|
76 |
+
CMD ["forego", "start", "-r"]
|
|
Dockerfile_new → Dockerfile_old
RENAMED
@@ -1,24 +1,34 @@
|
|
1 |
-
# Instruction for Dockerfile to create a new image on top of the base image (nvidia/cuda:11.0-base)
|
2 |
FROM alpine:latest
|
|
|
3 |
RUN apk add --update --no-cache openssh
|
4 |
-
RUN mkdir /var/run/sshd
|
5 |
-
RUN echo "root:root" | chpasswd
|
6 |
-
RUN sed -i 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config
|
7 |
-
RUN sed -i 's/#PasswordAuthentication yes/PasswordAuthentication yes/' /etc/ssh/sshd_config
|
8 |
RUN echo 'ListenAddress 0.0.0.0' >> /etc/ssh/sshd_config
|
9 |
RUN echo 'Port 7860' >> /etc/ssh/sshd_config
|
10 |
-
RUN echo '
|
11 |
-
|
12 |
RUN echo 'PubkeyAuthentication yes' >> /etc/ssh/sshd_config
|
13 |
RUN echo 'AllowTcpForwarding yes' >> /etc/ssh/sshd_config
|
14 |
RUN echo 'PermitTunnel yes' >> /etc/ssh/sshd_config
|
15 |
RUN echo 'GatewayPorts yes' >> /etc/ssh/sshd_config
|
|
|
|
|
|
|
16 |
|
17 |
RUN adduser -h /home/user -s /bin/sh -D user
|
|
|
18 |
USER user
|
19 |
ENV HOME=/home/user \
|
20 |
PATH=/home/user/.local/bin:$PATH
|
21 |
|
|
|
|
|
|
|
|
|
22 |
EXPOSE 7860
|
|
|
|
|
|
|
|
|
|
|
23 |
CMD ssh-keygen -t ed25519 -f $HOME/.ssh/id_ed25519 && \
|
24 |
/usr/sbin/sshd -h $HOME/.ssh/id_ed25519 -D -e "$@"
|
|
|
|
|
|
1 |
FROM alpine:latest
|
2 |
+
LABEL maintainer="victorych"
|
3 |
RUN apk add --update --no-cache openssh
|
|
|
|
|
|
|
|
|
4 |
RUN echo 'ListenAddress 0.0.0.0' >> /etc/ssh/sshd_config
|
5 |
RUN echo 'Port 7860' >> /etc/ssh/sshd_config
|
6 |
+
RUN echo 'PasswordAuthentication yes' >> /etc/ssh/sshd_config
|
7 |
+
RUN echo 'PermitRootLogin yes' >> /etc/ssh/sshd_config
|
8 |
RUN echo 'PubkeyAuthentication yes' >> /etc/ssh/sshd_config
|
9 |
RUN echo 'AllowTcpForwarding yes' >> /etc/ssh/sshd_config
|
10 |
RUN echo 'PermitTunnel yes' >> /etc/ssh/sshd_config
|
11 |
RUN echo 'GatewayPorts yes' >> /etc/ssh/sshd_config
|
12 |
+
RUN echo 'PidFile /home/user/ssh.pid' >> /etc/ssh/sshd_config
|
13 |
+
|
14 |
+
RUN cat /etc/ssh/sshd_config
|
15 |
|
16 |
RUN adduser -h /home/user -s /bin/sh -D user
|
17 |
+
RUN echo -n 'user:test' | chpasswd
|
18 |
USER user
|
19 |
ENV HOME=/home/user \
|
20 |
PATH=/home/user/.local/bin:$PATH
|
21 |
|
22 |
+
RUN mkdir $HOME/app
|
23 |
+
|
24 |
+
WORKDIR $HOME/app
|
25 |
+
|
26 |
EXPOSE 7860
|
27 |
+
|
28 |
+
USER root
|
29 |
+
|
30 |
+
RUN exit 1
|
31 |
+
|
32 |
CMD ssh-keygen -t ed25519 -f $HOME/.ssh/id_ed25519 && \
|
33 |
/usr/sbin/sshd -h $HOME/.ssh/id_ed25519 -D -e "$@"
|
34 |
+
# -D
|