Skip to content

Instantly share code, notes, and snippets.

@harshitanand
Forked from ltwlf/Dockerfile
Created November 19, 2019 23:38
Show Gist options
  • Save harshitanand/cf2a451f0750219a96c1c448f6020806 to your computer and use it in GitHub Desktop.
Save harshitanand/cf2a451f0750219a96c1c448f6020806 to your computer and use it in GitHub Desktop.
Base Docker Azure Function Node 10 image with SSH support
FROM mcr.microsoft.com/azure-functions/base
RUN apt-get update && \
apt-get install -y gnupg && \
curl -sL https://deb.nodesource.com/setup_10.x | bash - && \
apt-get update && \
apt-get install -y nodejs
ENV AzureWebJobsScriptRoot=/home/site/wwwroot
# SSH
COPY sshd_config /etc/ssh/
ENV SSH_PASSWD "root:Docker!"
RUN apt-get update \
&& apt-get install -y --no-install-recommends dialog \
&& apt-get update \
&& apt-get install -y --no-install-recommends openssh-server \
&& echo "$SSH_PASSWD" | chpasswd
EXPOSE 8000 2222
COPY start.sh /usr/local/bin/
RUN chmod +x /usr/local/bin/start.sh
CMD ["start.sh"]
# This is ssh server systemwide configuration file.
#
# /etc/sshd_config
Port 2222
ListenAddress 0.0.0.0
LoginGraceTime 180
X11Forwarding yes
Ciphers aes128-cbc,3des-cbc,aes256-cbc
MACs hmac-sha1,hmac-sha1-96
StrictModes yes
SyslogFacility DAEMON
PasswordAuthentication yes
PermitEmptyPasswords no
PermitRootLogin yes
#!/bin/bash
echo "Starting SSH..."
service ssh start
if [ -f /home/site/wwwroot/package.json ]; then
echo "Run npm install in /home/site/wwwroot..."
cd /home/site/wwwroot
npm install
else
echo "No package.json found in /home/site/wwwroot"
fi
echo "Starting Function Host..."
dotnet "/azure-functions-host/Microsoft.Azure.WebJobs.Script.WebHost.dll"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment