Skip to content

Commit

Permalink
Make the host selfcontained (#1171)
Browse files Browse the repository at this point in the history
  • Loading branch information
CooperLink authored Oct 1, 2024
1 parent 74c7d92 commit b3a93e7
Show file tree
Hide file tree
Showing 18 changed files with 19 additions and 19 deletions.
2 changes: 1 addition & 1 deletion host/4/bullseye/base/host.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ RUN BUILD_NUMBER=$(echo ${HOST_VERSION} | cut -d'.' -f 3) && \
git clone --branch v${HOST_VERSION} https://github.com/Azure/azure-functions-host /src/azure-functions-host && \
cd /src/azure-functions-host && \
HOST_COMMIT=$(git rev-list -1 HEAD) && \
dotnet publish -v q /p:BuildNumber=$BUILD_NUMBER /p:CommitHash=$HOST_COMMIT src/WebJobs.Script.WebHost/WebJobs.Script.WebHost.csproj -c Release --output /azure-functions-host --runtime linux-x64 && \
dotnet publish -v q /p:BuildNumber=$BUILD_NUMBER /p:CommitHash=$HOST_COMMIT src/WebJobs.Script.WebHost/WebJobs.Script.WebHost.csproj -c Release --output /azure-functions-host --self-contained --runtime linux-x64 && \

mv /azure-functions-host/workers /workers && mkdir /azure-functions-host/workers && \
rm -rf /root/.local /root/.nuget /src \;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ COPY sshd_config /etc/ssh/
COPY start.sh /azure-functions-host/
COPY install_ca_certificates.sh /opt/startup/
COPY --from=runtime-image [ "/azure-functions-host", "/azure-functions-host" ]
COPY --from=runtime-image [ "/usr/share/dotnet", "/usr/share/dotnet" ]


ENV AzureWebJobsScriptRoot=/home/site/wwwroot \
HOME=/home \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ COPY sshd_config /etc/ssh/
COPY start.sh /azure-functions-host/
COPY install_ca_certificates.sh /opt/startup/
COPY --from=runtime-image [ "/azure-functions-host", "/azure-functions-host" ]
COPY --from=runtime-image [ "/usr/share/dotnet", "/usr/share/dotnet" ]



ENV AzureWebJobsScriptRoot=/home/site/wwwroot \
Expand Down
2 changes: 1 addition & 1 deletion host/4/bullseye/java/java11/java11-composite.template
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ COPY sshd_config /etc/ssh/
COPY start.sh /azure-functions-host/
COPY install_ca_certificates.sh /opt/startup/
COPY --from=runtime-image [ "/azure-functions-host", "/azure-functions-host" ]
COPY --from=runtime-image [ "/usr/share/dotnet", "/usr/share/dotnet" ]

COPY --from=runtime-image [ "/workers/java", "/azure-functions-host/workers/java" ]

EXPOSE 2222 80
Expand Down
2 changes: 1 addition & 1 deletion host/4/bullseye/java/java17/java17-composite.template
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ COPY sshd_config /etc/ssh/
COPY start.sh /azure-functions-host/
COPY install_ca_certificates.sh /opt/startup/
COPY --from=runtime-image [ "/azure-functions-host", "/azure-functions-host" ]
COPY --from=runtime-image [ "/usr/share/dotnet", "/usr/share/dotnet" ]

COPY --from=runtime-image [ "/workers/java", "/azure-functions-host/workers/java" ]

EXPOSE 2222 80
Expand Down
2 changes: 1 addition & 1 deletion host/4/bullseye/java/java8/java8-composite.template
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ COPY sshd_config /etc/ssh/
COPY start.sh /azure-functions-host/
COPY install_ca_certificates.sh /opt/startup/
COPY --from=runtime-image [ "/azure-functions-host", "/azure-functions-host" ]
COPY --from=runtime-image [ "/usr/share/dotnet", "/usr/share/dotnet" ]

COPY --from=runtime-image [ "/workers/java", "/azure-functions-host/workers/java" ]

EXPOSE 2222 80
Expand Down
2 changes: 1 addition & 1 deletion host/4/bullseye/node/node14/node14-composite.template
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ COPY --from=runtime-image [ "/FuncExtensionBundles", "/FuncExtensionBundles" ]
COPY sshd_config /etc/ssh/
COPY start.sh /azure-functions-host/
COPY install_ca_certificates.sh /opt/startup/
COPY --from=runtime-image [ "/usr/share/dotnet", "/usr/share/dotnet" ]

COPY --from=runtime-image [ "/azure-functions-host", "/azure-functions-host" ]
COPY --from=runtime-image [ "/workers/node", "/azure-functions-host/workers/node" ]

Expand Down
2 changes: 1 addition & 1 deletion host/4/bullseye/node/node16/node16-composite.template
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ COPY start.sh /azure-functions-host/
COPY install_ca_certificates.sh /opt/startup/
COPY --from=runtime-image [ "/azure-functions-host", "/azure-functions-host" ]
COPY --from=runtime-image [ "/workers/node", "/azure-functions-host/workers/node" ]
COPY --from=runtime-image [ "/usr/share/dotnet", "/usr/share/dotnet" ]


# Chrome Headless Dependencies (01/2023)
# https://github.com/puppeteer/puppeteer/blob/main/docs/troubleshooting.md#chrome-headless-doesnt-launch-on-unix
Expand Down
2 changes: 1 addition & 1 deletion host/4/bullseye/node/node18/node18-composite.template
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ COPY --from=runtime-image [ "/FuncExtensionBundles", "/FuncExtensionBundles" ]
COPY sshd_config /etc/ssh/
COPY start.sh /azure-functions-host/
COPY install_ca_certificates.sh /opt/startup/
COPY --from=runtime-image [ "/usr/share/dotnet", "/usr/share/dotnet" ]

COPY --from=runtime-image [ "/azure-functions-host", "/azure-functions-host" ]
COPY --from=runtime-image [ "/workers/node", "/azure-functions-host/workers/node" ]

Expand Down
2 changes: 1 addition & 1 deletion host/4/bullseye/node/node20/node20-composite.template
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ COPY --from=runtime-image [ "/FuncExtensionBundles", "/FuncExtensionBundles" ]
COPY sshd_config /etc/ssh/
COPY start.sh /azure-functions-host/
COPY install_ca_certificates.sh /opt/startup/
COPY --from=runtime-image [ "/usr/share/dotnet", "/usr/share/dotnet" ]

COPY --from=runtime-image [ "/azure-functions-host", "/azure-functions-host" ]
COPY --from=runtime-image [ "/workers/node", "/azure-functions-host/workers/node" ]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ RUN apt-get update && \
apt-get install -y libc-dev

# copy bundles, host runtime and powershell worker from the build image
COPY --from=runtime-image [ "/usr/share/dotnet", "/usr/share/dotnet" ]

COPY --from=runtime-image ["/FuncExtensionBundles", "/FuncExtensionBundles"]
COPY --from=runtime-image ["/azure-functions-host", "/azure-functions-host"]
COPY --from=runtime-image ["/workers/powershell", "/azure-functions-host/workers/powershell"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ RUN apt-get update && \
apt-get install -y libc-dev

# copy bundles, host runtime and powershell worker from the build image
COPY --from=runtime-image [ "/usr/share/dotnet", "/usr/share/dotnet" ]

COPY --from=runtime-image ["/FuncExtensionBundles", "/FuncExtensionBundles"]
COPY --from=runtime-image ["/azure-functions-host", "/azure-functions-host"]
COPY --from=runtime-image ["/workers/powershell", "/azure-functions-host/workers/powershell"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
FROM mcr.microsoft.com/mirror/docker/library/python:3.10-slim-bullseye
ARG HOST_VERSION

COPY --from=runtime-image [ "/usr/share/dotnet", "/usr/share/dotnet" ]

COPY --from=runtime-image [ "/FuncExtensionBundles", "/FuncExtensionBundles" ]
COPY start.sh /azure-functions-host/
COPY install_ca_certificates.sh /opt/startup/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ RUN apt-get update && \
FROM mcr.microsoft.com/dotnet/runtime-deps:6.0
ARG HOST_VERSION

COPY --from=runtime-image [ "/usr/share/dotnet", "/usr/share/dotnet" ]

COPY --from=runtime-image [ "/FuncExtensionBundles", "/FuncExtensionBundles" ]
COPY sshd_config /etc/ssh/
COPY start.sh /azure-functions-host/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ RUN apt-get update && \
#apt-get install -y libc-dev && \


COPY --from=runtime-image [ "/usr/share/dotnet", "/usr/share/dotnet" ]

COPY --from=runtime-image ["/azure-functions-host", "/azure-functions-host"]
COPY --from=runtime-image [ "/workers/python/3.7/LINUX", "/azure-functions-host/workers/python/3.7/LINUX" ]
COPY --from=runtime-image [ "/workers/python/worker.config.json", "/azure-functions-host/workers/python" ]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ RUN apt-get update && \
# Fix from https://github.com/GoogleCloudPlatform/google-cloud-dotnet-powerpack/issues/22#issuecomment-729895157
#apt-get install -y libc-dev

COPY --from=runtime-image [ "/usr/share/dotnet", "/usr/share/dotnet" ]

COPY --from=runtime-image ["/azure-functions-host", "/azure-functions-host"]
COPY --from=runtime-image [ "/workers/python/3.8/LINUX", "/azure-functions-host/workers/python/3.8/LINUX" ]
COPY --from=runtime-image [ "/workers/python/worker.config.json", "/azure-functions-host/workers/python" ]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ RUN apt-get update && \
# Fix from https://github.com/GoogleCloudPlatform/google-cloud-dotnet-powerpack/issues/22#issuecomment-729895157
#apt-get install -y libc-dev && \

COPY --from=runtime-image [ "/usr/share/dotnet", "/usr/share/dotnet" ]

COPY --from=runtime-image ["/azure-functions-host", "/azure-functions-host"]
COPY --from=runtime-image [ "/workers/python/3.9/LINUX", "/azure-functions-host/workers/python/3.9/LINUX" ]
COPY --from=runtime-image [ "/workers/python/worker.config.json", "/azure-functions-host/workers/python" ]
Expand Down
4 changes: 2 additions & 2 deletions host/4/dotnet-isolated-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ pr:
- host/4/bullseye/dotnet-isolated/*
- host/4/bookworm/dotnet-isolated/*
- host/4/mariner/dotnet-isolated/*
- host/4/dotnet-solated-build.yml
- host/4/dotnet-isolated-build.yml

trigger:
branches:
Expand All @@ -28,7 +28,7 @@ variables:
value: ''

jobs:
- job: Dotnet
- job: Dotnet_Isolated
strategy:
matrix:
_isolated-net-6:
Expand Down

0 comments on commit b3a93e7

Please sign in to comment.