-
-
Save harshitanand/cf2a451f0750219a96c1c448f6020806 to your computer and use it in GitHub Desktop.
Base Docker Azure Function Node 10 image with SSH support
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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