mirror of
https://github.com/linuxserver/docker-openssh-server.git
synced 2026-01-20 11:52:09 +08:00
34 lines
1.0 KiB
Docker
34 lines
1.0 KiB
Docker
FROM ghcr.io/linuxserver/baseimage-alpine:3.13
|
|
|
|
# set version label
|
|
ARG BUILD_DATE
|
|
ARG VERSION
|
|
ARG OPENSSH_RELEASE
|
|
LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DATE}"
|
|
LABEL maintainer="aptalca"
|
|
|
|
RUN \
|
|
echo "**** install runtime packages ****" && \
|
|
apk add --no-cache --upgrade \
|
|
curl \
|
|
logrotate \
|
|
nano \
|
|
sudo && \
|
|
echo "**** install openssh-server ****" && \
|
|
if [ -z ${OPENSSH_RELEASE+x} ]; then \
|
|
OPENSSH_RELEASE=$(curl -sL "http://dl-cdn.alpinelinux.org/alpine/v3.13/main/x86_64/APKINDEX.tar.gz" | tar -xz -C /tmp \
|
|
&& awk '/^P:openssh-server$/,/V:/' /tmp/APKINDEX | sed -n 2p | sed 's/^V://'); \
|
|
fi && \
|
|
apk add --no-cache \
|
|
openssh-client==${OPENSSH_RELEASE} \
|
|
openssh-server==${OPENSSH_RELEASE} \
|
|
openssh-sftp-server==${OPENSSH_RELEASE} && \
|
|
echo "**** setup openssh environment ****" && \
|
|
sed -i 's/#PasswordAuthentication yes/PasswordAuthentication no/g' /etc/ssh/sshd_config && \
|
|
usermod --shell /bin/bash abc && \
|
|
rm -rf \
|
|
/tmp/*
|
|
|
|
# add local files
|
|
COPY /root /
|