-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
dockerfile, docker-compose.yml - builds and runs with agent enabled o…
…n ubuntu, debian and alpine amd64
- Loading branch information
1 parent
0a23b4a
commit 1e469a2
Showing
4 changed files
with
89 additions
and
7 deletions.
There are no files selected for viewing
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,6 @@ | ||
AGENT_PATH=../../../../src/Agent/newrelichome_x64_coreclr_linux | ||
LOG_PATH=./logs | ||
|
||
NEW_RELIC_LICENSE_KEY=78dc6026a9304e2e244e943555f0add873427d1d | ||
NEW_RELIC_HOST=staging-collector.newrelic.com | ||
NEW_RELIC_APP_NAME=SmokeTestApp |
27 changes: 20 additions & 7 deletions
27
tests/Agent/IntegrationTests/ContainerApplications/SmokeTestApp/Dockerfile
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 |
---|---|---|
@@ -1,25 +1,38 @@ | ||
#See https://aka.ms/customizecontainer to learn how to customize your debug container and how Visual Studio uses this Dockerfile to build your images for faster debugging. | ||
|
||
FROM mcr.microsoft.com/dotnet/aspnet:7.0 AS base | ||
ARG RESOURCE_REAPER_SESSION_ID="00000000-0000-0000-0000-000000000000" | ||
ARG DISTRO_TAG | ||
FROM mcr.microsoft.com/dotnet/aspnet:${DISTRO_TAG} AS base | ||
WORKDIR /app | ||
EXPOSE 80 | ||
|
||
FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build | ||
ARG RESOURCE_REAPER_SESSION_ID="00000000-0000-0000-0000-000000000000" | ||
FROM mcr.microsoft.com/dotnet/sdk:${DISTRO_TAG} AS build | ||
WORKDIR /src | ||
COPY ["ContainerApplications/SmokeTestApp/SmokeTestApp.csproj", "SmokeTestApp/"] | ||
COPY ["SmokeTestApp/SmokeTestApp.csproj", "SmokeTestApp/"] | ||
RUN dotnet restore "SmokeTestApp/SmokeTestApp.csproj" | ||
COPY . . | ||
WORKDIR "/src/SmokeTestApp" | ||
RUN dotnet build "SmokeTestApp.csproj" -c Release -o /app/build | ||
|
||
FROM build AS publish | ||
ARG RESOURCE_REAPER_SESSION_ID="00000000-0000-0000-0000-000000000000" | ||
RUN dotnet publish "SmokeTestApp.csproj" -c Release -o /app/publish /p:UseAppHost=false | ||
|
||
FROM base AS final | ||
ARG RESOURCE_REAPER_SESSION_ID="00000000-0000-0000-0000-000000000000" | ||
|
||
# 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"] |
50 changes: 50 additions & 0 deletions
50
tests/Agent/IntegrationTests/ContainerApplications/docker-compose.yml
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,50 @@ | ||
version: "3" | ||
|
||
services: | ||
smoketestapp-debian: | ||
build: | ||
context: . | ||
dockerfile: SmokeTestApp/Dockerfile | ||
args: | ||
DISTRO_TAG: 7.0-bullseye-slim-amd64 | ||
NEW_RELIC_LICENSE_KEY: ${NEW_RELIC_LICENSE_KEY} | ||
NEW_RELIC_APP_NAME: ${NEW_RELIC_APP_NAME} | ||
NEW_RELIC_HOST: ${NEW_RELIC_HOST} | ||
|
||
ports: | ||
- "8001:80" | ||
volumes: | ||
- ${AGENT_PATH}:/usr/local/newrelic-dotnet-agent # AGENT_PATH from .env, points to newrelichome_linux_x64 | ||
- ${LOG_PATH}:/app/logs # LOG_PATH from .env, should be a folder unique to this run of the smoketest app | ||
|
||
smoketestapp-alpine: | ||
build: | ||
context: . | ||
dockerfile: SmokeTestApp/Dockerfile | ||
args: | ||
DISTRO_TAG: 7.0-alpine-amd64 | ||
NEW_RELIC_LICENSE_KEY: ${NEW_RELIC_LICENSE_KEY} | ||
NEW_RELIC_APP_NAME: ${NEW_RELIC_APP_NAME} | ||
NEW_RELIC_HOST: ${NEW_RELIC_HOST} | ||
ports: | ||
- "8002:80" | ||
volumes: | ||
- ${AGENT_PATH}:/usr/local/newrelic-dotnet-agent # AGENT_PATH from .env, points to newrelichome_linux_x64 | ||
- ${LOG_PATH}:/app/logs # LOG_PATH from .env, should be a folder unique to this run of the smoketest app | ||
|
||
smoketestapp-ubuntu: | ||
build: | ||
context: . | ||
dockerfile: SmokeTestApp/Dockerfile | ||
args: | ||
DISTRO_TAG: 7.0-jammy-amd64 | ||
NEW_RELIC_LICENSE_KEY: ${NEW_RELIC_LICENSE_KEY} | ||
NEW_RELIC_APP_NAME: ${NEW_RELIC_APP_NAME} | ||
NEW_RELIC_HOST: ${NEW_RELIC_HOST} | ||
ports: | ||
- "8003:80" | ||
volumes: | ||
- ${AGENT_PATH}:/usr/local/newrelic-dotnet-agent # AGENT_PATH from .env, points to newrelichome_linux_x64 | ||
- ${LOG_PATH}:/app/logs # LOG_PATH from .env, should be a folder unique to this run of the smoketest app | ||
|
||
|
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