-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
bd96e4b
commit 337d257
Showing
4 changed files
with
84 additions
and
0 deletions.
There are no files selected for viewing
43 changes: 43 additions & 0 deletions
43
tests/Agent/IntegrationTests/ContainerApplications/SmokeTestApp/Dockerfile.amazon
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
ARG TARGET_ARCH | ||
FROM --platform=${TARGET_ARCH} amazonlinux:latest AS base | ||
WORKDIR /app | ||
EXPOSE 80 | ||
|
||
# build image is always amd64 (to match the runner architecture), even though the target architecture may be arm64 | ||
FROM --platform=amd64 mcr.microsoft.com/dotnet/sdk AS build | ||
ARG TARGET_ARCH | ||
WORKDIR /src | ||
COPY ["SmokeTestApp/SmokeTestApp.csproj", "SmokeTestApp/"] | ||
RUN dotnet restore "SmokeTestApp/SmokeTestApp.csproj" -a ${TARGET_ARCH} | ||
|
||
COPY . . | ||
WORKDIR "/src/SmokeTestApp" | ||
RUN dotnet build "SmokeTestApp.csproj" -c Release -o /app/build --os linux -a ${TARGET_ARCH} | ||
|
||
FROM build AS publish | ||
RUN dotnet publish "SmokeTestApp.csproj" -c Release -o /app/publish /p:UseAppHost=false --os linux -a ${TARGET_ARCH} | ||
|
||
FROM base AS final | ||
|
||
# install asp.netcore - use the Centos 7 package feed because amazon is rhel based | ||
RUN rpm -Uvh https://packages.microsoft.com/config/centos/7/packages-microsoft-prod.rpm | ||
RUN yum install aspnetcore-runtime-7.0 -y | ||
|
||
# Enable the agent | ||
ARG NEW_RELIC_HOST | ||
ARG NEW_RELIC_LICENSE_KEY | ||
ARG NEW_RELIC_APP_NAME | ||
|
||
ENV CORECLR_ENABLE_PROFILING=1 \ | ||
CORECLR_PROFILER={36032161-FFC0-4B61-B559-F6C5D41BAE5A} \ | ||
CORECLR_NEWRELIC_HOME=/usr/local/newrelic-dotnet-agent \ | ||
CORECLR_PROFILER_PATH=/usr/local/newrelic-dotnet-agent/libNewRelicProfiler.so \ | ||
NEW_RELIC_HOST=${NEW_RELIC_HOST} \ | ||
NEW_RELIC_LICENSE_KEY=${NEW_RELIC_LICENSE_KEY} \ | ||
NEW_RELIC_APP_NAME=${NEW_RELIC_APP_NAME} \ | ||
NEWRELIC_LOG_DIRECTORY=/app/logs | ||
|
||
WORKDIR /app | ||
COPY --from=publish /app/publish . | ||
|
||
ENTRYPOINT ["dotnet", "SmokeTestApp.dll"] |
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 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 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