File tree Expand file tree Collapse file tree 4 files changed +23
-9
lines changed
Expand file tree Collapse file tree 4 files changed +23
-9
lines changed Original file line number Diff line number Diff line change 11# BUILDER
2- FROM crystallang/crystal:1.12-alpine as BUILDER
2+ FROM --platform=linux/amd64 crystallang/crystal:1.12 as BUILDER
33
44WORKDIR /app
55
@@ -9,7 +9,7 @@ COPY sshd_config.ecr /app
99RUN crystal build entrypoint.cr --release --no-debug
1010
1111# IMAGE
12- FROM alpine:3.19.1
12+ FROM --platform=linux/amd64 ubuntu:22.04
1313
1414LABEL org.opencontainers.image.source https://github.com/Container-Driven-Development/sftp
1515
@@ -25,13 +25,25 @@ ENTRYPOINT ["/entrypoint"]
2525
2626EXPOSE "${SSHD_PORT}/tcp"
2727
28- RUN apk --no-cache add openssh openssh-sftp-server pcre libgcc mariadb-client curl busybox-extras
28+ # pcre \
29+ # libgcc \
30+ # busybox-extras \
31+
32+
33+ RUN apt-get update && apt-get install -y openssh-server \
34+ openssh-sftp-server \
35+ mariadb-client \
36+ curl \
37+ libevent-2.1-7 \
38+ && rm -rf /var/lib/apt/lists/*
39+
40+ RUN mkdir /var/run/sshd
2941
3042COPY --from=BUILDER /app/entrypoint /entrypoint
3143
32- RUN delgroup ${SSH_GROUP_NAME } && \
33- addgroup -g ${SSH_GROUP_ID} -S ${SSH_USER_NAME} && \
34- adduser -D -h ${SSH_HOMEDIR} -u ${SSH_USER_ID} -G ${SSH_GROUP_NAME} -s /bin/sh ${SSH_USER_NAME} && \
44+ RUN deluser ${SSH_USER_NAME } && \
45+ addgroup --gid ${SSH_GROUP_ID} ${SSH_USER_NAME} && \
46+ adduser --home ${SSH_HOMEDIR} --uid ${SSH_USER_ID} --ingroup ${SSH_GROUP_NAME} --shell /bin/sh ${SSH_USER_NAME} && \
3547 echo "${SSH_USER_NAME}:*" | chpasswd -e && \
3648 chown root:root ${SSH_HOMEDIR} && \
3749 chmod 755 /var/www && \
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ services:
22
33 sftp :
44 image : sftp
5+ platform : linux/amd64
56 build :
67 context : .
78 dockerfile : Dockerfile
@@ -16,6 +17,7 @@ services:
1617 retries : 20
1718
1819 sftp-test :
20+ platform : linux/amd64
1921 image : sftp
2022 build :
2123 context : .
Original file line number Diff line number Diff line change @@ -21,4 +21,4 @@ version: 0.1.0
2121# incremented each time you make changes to the application. Versions are not expected to
2222# follow Semantic Versioning. They should reflect the version the application is using.
2323# It is recommended to use it with quotes.
24- appVersion : " 3.0 "
24+ appVersion : " v3.2 "
Original file line number Diff line number Diff line change @@ -4,10 +4,10 @@ TARGET_HOST=$1
44SSH_USER=www-data
55
66touch index.php
7-
7+ chmod 400 /var/www/.ssh/id_ed25519
88sftp -i /var/www/.ssh/id_ed25519 -oStrictHostKeyChecking=no -P36622 ${SSH_USER} @${TARGET_HOST}
99 << EOF
1010cd data
1111put index.php
1212quit
13- EOF
13+ EOF
You can’t perform that action at this time.
0 commit comments