> For the complete documentation index, see [llms.txt](https://docs.sealights.io/knowledgebase/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.sealights.io/knowledgebase/setup-and-configuration/sealights-agents-and-plugins/.net-core-agent/capturing-coverage-from-the-application/sample-docker-files.md).

# Sample Docker Files

{% code overflow="wrap" lineNumbers="true" %}

```docker
## Dockerfile
FROM mcr.microsoft.com/dotnet/aspnet:6.0

# Sealights - copy agent, token and custom entry point
COPY --from=publish /tmp/sl-dotnet-agent /tmp/sl-dotnet-agent
COPY ["SeaLights/sltoken.txt", "/tmp/sl-dotnet-agent"]
COPY ["SeaLights/docker_entrypoint.sh", "/app/publish"]

WORKDIR /app
COPY --from=publish /app/publish .

ENTRYPOINT ["/app/docker_entrypoint.sh"]
```

{% endcode %}

ENTRYPOINT

{% code overflow="wrap" lineNumbers="true" %}

```sh
#!/bin/sh
echo Will start the app with Sealights
export SL_LogLevel='6'
export SL_LogDir='/tmp/sl_logs/'
dotnet /tmp/sl-dotnet-agent/SL.DotNet.dll run --instrumentationMode coverage --buildSessionIdFile /tmp/sl-dotnet-agent/buildSessionId.txt --labId <labid> --includeNamespace <namespace> --target dotnet --workingDir /app --targetArgs "MyApp.dll" --logAppendFile true --logFilename "/tmp/sl_logs/collector"
```

{% endcode %}

## Alpine-based docker file for a self-contained app <a href="#alpine-based-docker-file-for-a-self-contained-app" id="alpine-based-docker-file-for-a-self-contained-app"></a>

{% code overflow="wrap" lineNumbers="true" %}

```docker
# https://mcr.microsoft.com/v2/dotnet/runtime-deps/tags/list
FROM mcr.microsoft.com/dotnet/runtime-deps:6.0.3-alpine3.15-amd64
WORKDIR /
...

# Sealights - install prereq, agent, token, bsid
RUN mkdir -p /sealights/{agent,logs}
RUN wget -nv -O sealights-dotnet-agent-alpine.tar.gz https://agents.sealights.co/dotnetcore/latest/sealights-dotnet-agent-alpine-self-contained.tar.gz
RUN tar -xzf ./sealights-dotnet-agent-alpine.tar.gz --directory /sealights/agent
COPY ["SeaLights/sltoken.txt", "/sealights/"]
COPY ["SeaLights/buildSessionId.txt", "/sealights/"]
RUN chmod -R 777 /sealights

WORKDIR /app
COPY --from=builder /cartservice .
ENTRYPOINT ["/sealights/agent/SL.DotNet run --instrumentationMode coverage --buildSessionIdFile /sealights/buildSessionId.txt --tokenFile /sealights/sltoken.txt --labId <labid> --includeNamespace <namespace> --workingDir /app --target /app/cartservice"]
```

{% endcode %}

{% hint style="info" %}
To enable SL logs, append to the ENTRYPOINT command the following parameters: `--profilerLogDir /sealights/logs --profilerLogLevel 6 --logAppendFile true --logFilename /sealights/logs/collector`
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.sealights.io/knowledgebase/setup-and-configuration/sealights-agents-and-plugins/.net-core-agent/capturing-coverage-from-the-application/sample-docker-files.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
