mirror of
https://github.com/rust-lang/cargo.git
synced 2025-09-25 11:14:46 +00:00

libcrypto3 is required because openssh-10.0_p1-r8 needs a newer version of libcrypto3 (3.5.3-r1 as of this writing). However, the pre-installed one on the image is 3.3.2-r4, and the one the registry is 3.5.1-r0 Hence an `apk upgrade` is required. We should remove this someday when upstream fixes it. Also, I've tried `alpine:edge`, but edge hasn't yet upgrade the pre-installed libssl3 nor the registry To repro: ```console / # apk info openssh openssh-10.0_p1-r8 description: Port of OpenBSD's free SSH release openssh-10.0_p1-r8 webpage: https://www.openssh.com/portable.html openssh-10.0_p1-r8 installed size: 330 KiB / # apk info -R openssh openssh-10.0_p1-r8 depends on: openssh-client openssh-sftp-server openssh-server so:libc.musl-x86_64.so.1 so:libcrypto.so.3 / # apk info libcrypto3 libcrypto3-3.5.1-r0 description: Crypto library from openssl libcrypto3-3.5.1-r0 webpage: https://www.openssl.org/ libcrypto3-3.5.1-r0 installed size: 5091 KiB libcrypto3-3.5.3-r0 description: Crypto library from openssl libcrypto3-3.5.3-r0 webpage: https://www.openssl.org/ libcrypto3-3.5.3-r0 installed size: 5091 KiB / # strings /usr/lib/libcrypto.so.3 | grep -i "OpenSSL" ... OpenSSL 3.5.1 1 Jul 2025 ... ```
30 lines
851 B
Docker
30 lines
851 B
Docker
FROM alpine:3.22
|
|
|
|
RUN apk add --no-cache openssh git
|
|
RUN apk upgrade --no-cache libcrypto3
|
|
RUN ssh-keygen -A
|
|
|
|
RUN addgroup -S testuser && adduser -S testuser -G testuser -s /bin/ash
|
|
# NOTE: Ideally the password should be set to *, but I am uncertain how to do
|
|
# that in alpine. It shouldn't matter since PermitEmptyPasswords is "no".
|
|
RUN passwd -u testuser
|
|
|
|
RUN mkdir /repos && chown testuser /repos
|
|
COPY --chown=testuser:testuser bar /repos/bar
|
|
USER testuser
|
|
WORKDIR /repos/bar
|
|
RUN git config --global user.email "testuser@example.com" &&\
|
|
git config --global user.name "Test User" &&\
|
|
git init -b master . &&\
|
|
git add Cargo.toml src &&\
|
|
git commit -m "Initial commit" &&\
|
|
cd .. &&\
|
|
git clone --bare bar bar.git &&\
|
|
rm -rf bar
|
|
WORKDIR /
|
|
USER root
|
|
|
|
EXPOSE 22
|
|
|
|
ENTRYPOINT ["/usr/sbin/sshd", "-D", "-E", "/var/log/auth.log"]
|