Skip to content

Commit ec5076a

Browse files
Update Dockerfile to use Ubuntu 22.04 instead of Alpine 3.19.1
Signed-off-by: Mario Vejlupek <[email protected]>
1 parent 33cb8e3 commit ec5076a

File tree

4 files changed

+23
-9
lines changed

4 files changed

+23
-9
lines changed

Dockerfile

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# BUILDER
2-
FROM crystallang/crystal:1.12-alpine as BUILDER
2+
FROM --platform=linux/amd64 crystallang/crystal:1.12 as BUILDER
33

44
WORKDIR /app
55

@@ -9,7 +9,7 @@ COPY sshd_config.ecr /app
99
RUN 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

1414
LABEL org.opencontainers.image.source https://github.com/Container-Driven-Development/sftp
1515

@@ -25,13 +25,25 @@ ENTRYPOINT ["/entrypoint"]
2525

2626
EXPOSE "${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

3042
COPY --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 && \

docker-compose.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff 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: .

k8s/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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"

test/test.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ TARGET_HOST=$1
44
SSH_USER=www-data
55

66
touch index.php
7-
7+
chmod 400 /var/www/.ssh/id_ed25519
88
sftp -i /var/www/.ssh/id_ed25519 -oStrictHostKeyChecking=no -P36622 ${SSH_USER}@${TARGET_HOST}
99
<<EOF
1010
cd data
1111
put index.php
1212
quit
13-
EOF
13+
EOF

0 commit comments

Comments
 (0)