> For the complete documentation index, see [llms.txt](https://oasis-web4.gitbook.io/oasis-web4-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://oasis-web4.gitbook.io/oasis-web4-docs/docker/comparison.md).

# Dockerfile Comparison: Previous Working vs Current

## Previous Working Image (`mainnet-update`)

**Image ID**: `96a7bd158ecb`\
**Digest**: `sha256:96a7bd158ecb93b459fca9e65155fed14e233328d921a42d6b2a7f69bb0cf3d6`\
**Created**: September 24, 2025

### Key Characteristics

1. **.NET Version**: 9.0.9
2. **Ports**: 80, 443
3. **Configuration**: Includes `OASIS_DNA.json` copied to `/app`
4. **Build Method**: Multi-stage build with publish directory
5. **Size**: 522MB (149MB compressed in ECR)

### Build History Analysis

From `docker history`, the previous image:

* Used .NET 9.0.9 runtime and SDK
* Copied published files from `/app/publish` to `/app`
* Included `OASIS_DNA.json` configuration file
* Set environment variables: `ASPNETCORE_ENVIRONMENT=Production`, `ASPNETCORE_URLS=http://+:80`
* Exposed ports 80 and 443

## Current Dockerfile (`docker/Dockerfile`)

### Improvements

1. **Solution File Restoration**: Uses `The OASIS.sln` to restore all dependencies
2. **Optimized Build Context**: Better `.dockerignore` to reduce build size
3. **Provider Inclusion**: Ensures all 30+ providers are included via solution file
4. **Configuration Handling**: Attempts to copy `OASIS_DNA.json` from multiple locations

### Differences

| Aspect             | Previous Working              | Current                        |
| ------------------ | ----------------------------- | ------------------------------ |
| Build Context      | Unknown (likely large)        | Optimized with `.dockerignore` |
| Solution File      | Not explicitly used           | Explicitly restored            |
| Configuration      | Copied from specific location | Tries multiple locations       |
| .NET Version       | 9.0.9                         | 9.0 (latest)                   |
| Port Configuration | 80, 443                       | 80, 443                        |

## Recommendations

1. **Use Solution File**: The current approach of restoring from solution file is correct
2. **Include OASIS\_DNA.json**: Ensure configuration file is copied (previous image had this)
3. **Build Context**: Current `.dockerignore` is good, but ensure required directories are included
4. **Dependencies**: Make sure `NextGenSoftware-Libraries` and `holochain-client-csharp` are included

## Migration Notes

The previous working image was likely built with:

* All source code copied
* Solution file used for restoration
* Published output copied to final image
* Configuration file explicitly included

The current Dockerfile follows the same pattern but with:

* Better organization
* More explicit dependency management
* Optimized build context


---

# 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 dynamically by asking a question.

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

```
GET https://oasis-web4.gitbook.io/oasis-web4-docs/docker/comparison.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 `build a script that syncs our docs to a CMS` 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.
