mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2025-03-03 17:36:59 +01:00
Generate SSH keys in the docker container
This commit is contained in:
parent
3dada3c464
commit
6d703d590b
3 changed files with 13 additions and 2 deletions
|
@ -16,7 +16,7 @@ RUN cd BTCPayServer && dotnet publish --output /app/ --configuration Release
|
|||
FROM mcr.microsoft.com/dotnet/core/aspnet:2.1.9-alpine3.7
|
||||
|
||||
ENV DOTNET_SYSTEM_GLOBALIZATION_INVARIANT false
|
||||
RUN apk add --no-cache icu-libs
|
||||
RUN apk add --no-cache icu-libs openssh-keygen
|
||||
|
||||
ENV LC_ALL en_US.UTF-8
|
||||
ENV LANG en_US.UTF-8
|
||||
|
|
|
@ -20,7 +20,7 @@ RUN cd BTCPayServer && dotnet publish --output /app/ --configuration Release
|
|||
# Force the builder machine to take make an arm runtime image. This is fine as long as the builder does not run any program
|
||||
FROM mcr.microsoft.com/dotnet/core/aspnet:2.1.9-stretch-slim-arm32v7
|
||||
COPY --from=builder /usr/bin/qemu-arm-static /usr/bin/qemu-arm-static
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends iproute2 \
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends iproute2 openssh-client \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
ENV LC_ALL en_US.UTF-8
|
||||
|
|
|
@ -1,4 +1,15 @@
|
|||
#!/bin/sh
|
||||
|
||||
echo "$(/sbin/ip route|awk '/default/ { print $3 }') host.docker.internal" >> /etc/hosts
|
||||
|
||||
if ! [ -f "$BTCPAY_SSHKEYFILE" ]; then
|
||||
echo "Creating BTCPay Server SSH key File..."
|
||||
ssh-keygen -t rsa -f "$BTCPAY_SSHKEYFILE" -q -P "" -m PEM -C btcpayserver > /dev/null
|
||||
fi
|
||||
|
||||
if [ -f "$BTCPAY_SSHAUTHORIZEDKEYS" ] && ! grep -q "btcpayserver$" "$BTCPAY_SSHAUTHORIZEDKEYS"; then
|
||||
echo "Adding BTCPay Server SSH key to authorized keys"
|
||||
cat "$BTCPAY_SSHKEYFILE.pub" >> "$BTCPAY_SSHAUTHORIZEDKEYS"
|
||||
fi
|
||||
|
||||
exec dotnet BTCPayServer.dll
|
||||
|
|
Loading…
Add table
Reference in a new issue