[
  {
    "path": ".github/workflows/images.yaml",
    "content": "name: Build Images\n\non:\n  push:\n    tags:\n      - \"*\"\n\npermissions:\n  contents: read\n\nenv:\n  IMAGE_NAME: \"synadia/nats-server\"\n  LINUX_ARCHS_2_10: \"linux/arm64,linux/arm/v6,linux/arm/v7,linux/amd64,linux/386,linux/s390x,linux/ppc64le\"\n  LINUX_ARCHS: \"linux/arm64,linux/arm/v6,linux/arm/v7,linux/amd64,linux/386,linux/s390x,linux/ppc64le\"\n\njobs:\n  linux-2_10:\n    name: Build Linux (2.10.x)\n    if: ${{ startsWith(github.ref_name,  'v2.10.') }}\n    runs-on: ubuntu-latest\n\n    steps:\n      - name: Checkout repository\n        uses: actions/checkout@v4\n\n      - name: Log into Docker\n        uses: docker/login-action@v3\n        with:\n          username: ${{ secrets.DOCKER_USERNAME }}\n          password: ${{ secrets.DOCKER_TOKEN }}\n\n      - name: Set up Docker Buildx\n        uses: docker/setup-buildx-action@v3\n\n        # https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#setting-an-output-parameter\n      - name: Tag Version\n        id: ref\n        shell: bash\n        run: |\n          TAG=${{ github.ref_name }}\n          echo \"TAG=${TAG#v}\" >> \"$GITHUB_OUTPUT\"\n\n      - name: Alpine\n        uses: docker/build-push-action@v6\n        with:\n          context: ./2.10.x/alpine3.22/\n          platforms: ${{ env.LINUX_ARCHS_2_10 }}\n          push: true\n          tags: ${{ env.IMAGE_NAME }}:${{ steps.ref.outputs.TAG }}-alpine3.22\n          provenance: mode=max\n\n      - name: Scratch\n        uses: docker/build-push-action@v6\n        with:\n          context: ./2.10.x/scratch/\n          file: ./2.10.x/scratch/Dockerfile.preview\n          platforms: ${{ env.LINUX_ARCHS_2_10 }}\n          push: true\n          tags: ${{ env.IMAGE_NAME }}:${{ steps.ref.outputs.TAG }}-scratch\n          provenance: mode=max\n          build-args: |\n            BASE_IMAGE=${{ env.IMAGE_NAME }}:${{ steps.ref.outputs.TAG }}-alpine3.22\n\n  windows-2_10:\n    name: Test Windows Server LTSC ${{ matrix.ltsc }} (${{ matrix.version }})\n    if: ${{ startsWith(github.ref_name,  'v2.10.') }}\n    runs-on: windows-${{ matrix.ltsc }}\n    strategy:\n      fail-fast: false\n      matrix:\n        version:\n          - 2.10.x\n        ltsc:\n          - 2022\n          # - 2025\n\n    steps:\n      - name: Checkout repository\n        uses: actions/checkout@v4\n\n      - name: Log into Docker\n        uses: docker/login-action@v3\n        with:\n          username: ${{ secrets.DOCKER_USERNAME }}\n          password: ${{ secrets.DOCKER_TOKEN }}\n\n        # NOTE: bash is supported on Windows runners\n        # https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#setting-an-output-parameter\n      - name: Tag Version\n        id: ref\n        shell: bash\n        run: |\n          TAG=${{ github.ref_name }}\n          echo \"TAG=${TAG#v}\" >> \"$GITHUB_OUTPUT\"\n\n        # Buildx is not supported on Windows yet.\n      - name: windowsservercore-ltsc${{ matrix.ltsc }}\n        shell: pwsh\n        run: |\n          docker build `\n            --tag \"${{ env.IMAGE_NAME }}:${{ steps.ref.outputs.TAG }}-windowsservercore-ltsc${{ matrix.ltsc }}\" `\n            ./${{ matrix.version }}/windowsservercore-ltsc${{ matrix.ltsc }}\n\n          docker push \"${{ env.IMAGE_NAME }}:${{ steps.ref.outputs.TAG }}-windowsservercore-ltsc${{ matrix.ltsc }}\"\n\n      - name: nanoserver-ltsc${{ matrix.ltsc }}\n        shell: pwsh\n        run: |\n          docker build `\n            --file ./${{ matrix.version }}/nanoserver-ltsc${{ matrix.ltsc }}/Dockerfile.preview `\n            --build-arg \"BASE_IMAGE=${{ env.IMAGE_NAME }}:${{ steps.ref.outputs.TAG }}-windowsservercore-ltsc${{ matrix.ltsc }}\" `\n            --tag \"${{ env.IMAGE_NAME }}:${{ steps.ref.outputs.TAG }}-nanoserver-ltsc${{ matrix.ltsc }}\" `\n            ./${{ matrix.version }}/nanoserver-ltsc${{ matrix.ltsc }}\n\n          docker push \"${{ env.IMAGE_NAME }}:${{ steps.ref.outputs.TAG }}-nanoserver-ltsc${{ matrix.ltsc }}\"\n\n  linux-2_11:\n    name: Build Linux (2.11.x)\n    if: ${{ startsWith(github.ref_name,  'v2.11.') }}\n    runs-on: ubuntu-latest\n\n    steps:\n      - name: Checkout repository\n        uses: actions/checkout@v4\n\n      - name: Log into Docker\n        uses: docker/login-action@v3\n        with:\n          username: ${{ secrets.DOCKER_USERNAME }}\n          password: ${{ secrets.DOCKER_TOKEN }}\n\n      - name: Set up Docker Buildx\n        uses: docker/setup-buildx-action@v3\n\n      - name: Tag Version\n        id: ref\n        shell: bash\n        run: |\n          TAG=${{ github.ref_name }}\n          echo \"TAG=${TAG#v}\" >> \"$GITHUB_OUTPUT\"\n\n      - name: Alpine\n        uses: docker/build-push-action@v6\n        with:\n          context: ./2.11.x/alpine3.22/\n          platforms: ${{ env.LINUX_ARCHS }}\n          push: true\n          tags: ${{ env.IMAGE_NAME }}:${{ steps.ref.outputs.TAG }}-alpine3.22\n          provenance: mode=max\n\n      - name: Scratch\n        uses: docker/build-push-action@v6\n        with:\n          context: ./2.11.x/scratch/\n          file: ./2.11.x/scratch/Dockerfile.preview\n          platforms: ${{ env.LINUX_ARCHS }}\n          push: true\n          tags: ${{ env.IMAGE_NAME }}:${{ steps.ref.outputs.TAG }}-scratch\n          provenance: mode=max\n          build-args: |\n            BASE_IMAGE=${{ env.IMAGE_NAME }}:${{ steps.ref.outputs.TAG }}-alpine3.22\n\n  windows-2_11:\n    name: Test Windows Server LTSC ${{ matrix.ltsc }} (${{ matrix.version }})\n    if: ${{ startsWith(github.ref_name,  'v2.11.') }}\n    runs-on: windows-${{ matrix.ltsc }}\n    strategy:\n      fail-fast: false\n      matrix:\n        version:\n          - 2.11.x\n        ltsc:\n          - 2022\n          # - 2025\n\n    steps:\n      - name: Checkout repository\n        uses: actions/checkout@v4\n\n      - name: Log into Docker\n        uses: docker/login-action@v3\n        with:\n          username: ${{ secrets.DOCKER_USERNAME }}\n          password: ${{ secrets.DOCKER_TOKEN }}\n\n        # NOTE: bash is supported on Windows runners\n        # https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#setting-an-output-parameter\n      - name: Tag Version\n        id: ref\n        shell: bash\n        run: |\n          TAG=${{ github.ref_name }}\n          echo \"TAG=${TAG#v}\" >> \"$GITHUB_OUTPUT\"\n\n        # Buildx is not supported on Windows yet.\n      - name: windowsservercore-ltsc${{ matrix.ltsc }}\n        shell: pwsh\n        run: |\n          docker build `\n            --tag \"${{ env.IMAGE_NAME }}:${{ steps.ref.outputs.TAG }}-windowsservercore-ltsc${{ matrix.ltsc }}\" `\n            ./${{ matrix.version }}/windowsservercore-ltsc${{ matrix.ltsc }}\n\n          docker push \"${{ env.IMAGE_NAME }}:${{ steps.ref.outputs.TAG }}-windowsservercore-ltsc${{ matrix.ltsc }}\"\n\n      - name: nanoserver-ltsc${{ matrix.ltsc }}\n        shell: pwsh\n        run: |\n          docker build `\n            --file ./${{ matrix.version }}/nanoserver-ltsc${{ matrix.ltsc }}/Dockerfile.preview `\n            --build-arg \"BASE_IMAGE=${{ env.IMAGE_NAME }}:${{ steps.ref.outputs.TAG }}-windowsservercore-ltsc${{ matrix.ltsc }}\" `\n            --tag \"${{ env.IMAGE_NAME }}:${{ steps.ref.outputs.TAG }}-nanoserver-ltsc${{ matrix.ltsc }}\" `\n            ./${{ matrix.version }}/nanoserver-ltsc${{ matrix.ltsc }}\n\n          docker push \"${{ env.IMAGE_NAME }}:${{ steps.ref.outputs.TAG }}-nanoserver-ltsc${{ matrix.ltsc }}\"\n\n  linux-2_12:\n    name: Build Linux (2.12.x)\n    if: ${{ startsWith(github.ref_name,  'v2.12.') }}\n    runs-on: ubuntu-latest\n\n    steps:\n      - name: Checkout repository\n        uses: actions/checkout@v4\n\n      - name: Log into Docker\n        uses: docker/login-action@v3\n        with:\n          username: ${{ secrets.DOCKER_USERNAME }}\n          password: ${{ secrets.DOCKER_TOKEN }}\n\n      - name: Set up Docker Buildx\n        uses: docker/setup-buildx-action@v3\n\n      - name: Tag Version\n        id: ref\n        shell: bash\n        run: |\n          TAG=${{ github.ref_name }}\n          echo \"TAG=${TAG#v}\" >> \"$GITHUB_OUTPUT\"\n\n      - name: Alpine\n        uses: docker/build-push-action@v6\n        with:\n          context: ./2.12.x/alpine3.22/\n          platforms: ${{ env.LINUX_ARCHS }}\n          push: true\n          tags: ${{ env.IMAGE_NAME }}:${{ steps.ref.outputs.TAG }}-alpine3.22\n          provenance: mode=max\n\n      - name: Scratch\n        uses: docker/build-push-action@v6\n        with:\n          context: ./2.12.x/scratch/\n          file: ./2.12.x/scratch/Dockerfile.preview\n          platforms: ${{ env.LINUX_ARCHS }}\n          push: true\n          tags: ${{ env.IMAGE_NAME }}:${{ steps.ref.outputs.TAG }}-scratch\n          provenance: mode=max\n          build-args: |\n            BASE_IMAGE=${{ env.IMAGE_NAME }}:${{ steps.ref.outputs.TAG }}-alpine3.22\n\n  windows-2_12:\n    name: Test Windows Server LTSC ${{ matrix.ltsc }} (${{ matrix.version }})\n    if: ${{ startsWith(github.ref_name,  'v2.12.') }}\n    runs-on: windows-${{ matrix.ltsc }}\n    strategy:\n      fail-fast: false\n      matrix:\n        version:\n          - 2.12.x\n        ltsc:\n          - 2022\n          # - 2025\n\n    steps:\n      - name: Checkout repository\n        uses: actions/checkout@v4\n\n      - name: Log into Docker\n        uses: docker/login-action@v3\n        with:\n          username: ${{ secrets.DOCKER_USERNAME }}\n          password: ${{ secrets.DOCKER_TOKEN }}\n\n        # NOTE: bash is supported on Windows runners\n        # https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#setting-an-output-parameter\n      - name: Tag Version\n        id: ref\n        shell: bash\n        run: |\n          TAG=${{ github.ref_name }}\n          echo \"TAG=${TAG#v}\" >> \"$GITHUB_OUTPUT\"\n\n        # Buildx is not supported on Windows yet.\n      - name: windowsservercore-ltsc${{ matrix.ltsc }}\n        shell: pwsh\n        run: |\n          docker build `\n            --tag \"${{ env.IMAGE_NAME }}:${{ steps.ref.outputs.TAG }}-windowsservercore-ltsc${{ matrix.ltsc }}\" `\n            ./${{ matrix.version }}/windowsservercore-ltsc${{ matrix.ltsc }}\n\n          docker push \"${{ env.IMAGE_NAME }}:${{ steps.ref.outputs.TAG }}-windowsservercore-ltsc${{ matrix.ltsc }}\"\n\n      - name: nanoserver-ltsc${{ matrix.ltsc }}\n        shell: pwsh\n        run: |\n          docker build `\n            --file ./${{ matrix.version }}/nanoserver-ltsc${{ matrix.ltsc }}/Dockerfile.preview `\n            --build-arg \"BASE_IMAGE=${{ env.IMAGE_NAME }}:${{ steps.ref.outputs.TAG }}-windowsservercore-ltsc${{ matrix.ltsc }}\" `\n            --tag \"${{ env.IMAGE_NAME }}:${{ steps.ref.outputs.TAG }}-nanoserver-ltsc${{ matrix.ltsc }}\" `\n            ./${{ matrix.version }}/nanoserver-ltsc${{ matrix.ltsc }}\n\n          docker push \"${{ env.IMAGE_NAME }}:${{ steps.ref.outputs.TAG }}-nanoserver-ltsc${{ matrix.ltsc }}\"\n\n  linux-2_14:\n    name: Build Linux (2.14.x)\n    if: ${{ startsWith(github.ref_name,  'v2.14.') }}\n    runs-on: ubuntu-latest\n\n    steps:\n      - name: Checkout repository\n        uses: actions/checkout@v4\n\n      - name: Log into Docker\n        uses: docker/login-action@v3\n        with:\n          username: ${{ secrets.DOCKER_USERNAME }}\n          password: ${{ secrets.DOCKER_TOKEN }}\n\n      - name: Set up Docker Buildx\n        uses: docker/setup-buildx-action@v3\n\n      - name: Tag Version\n        id: ref\n        shell: bash\n        run: |\n          TAG=${{ github.ref_name }}\n          echo \"TAG=${TAG#v}\" >> \"$GITHUB_OUTPUT\"\n\n      - name: Alpine\n        uses: docker/build-push-action@v6\n        with:\n          context: ./2.14.x/alpine3.22/\n          platforms: ${{ env.LINUX_ARCHS }}\n          push: true\n          tags: ${{ env.IMAGE_NAME }}:${{ steps.ref.outputs.TAG }}-alpine3.22\n          provenance: mode=max\n\n      - name: Scratch\n        uses: docker/build-push-action@v6\n        with:\n          context: ./2.14.x/scratch/\n          file: ./2.14.x/scratch/Dockerfile.preview\n          platforms: ${{ env.LINUX_ARCHS }}\n          push: true\n          tags: ${{ env.IMAGE_NAME }}:${{ steps.ref.outputs.TAG }}-scratch\n          provenance: mode=max\n          build-args: |\n            BASE_IMAGE=${{ env.IMAGE_NAME }}:${{ steps.ref.outputs.TAG }}-alpine3.22\n\n  windows-2_14:\n    name: Test Windows Server LTSC ${{ matrix.ltsc }} (${{ matrix.version }})\n    if: ${{ startsWith(github.ref_name,  'v2.14.') }}\n    runs-on: windows-${{ matrix.ltsc }}\n    strategy:\n      fail-fast: false\n      matrix:\n        version:\n          - 2.14.x\n        ltsc:\n          - 2022\n          # - 2025\n\n    steps:\n      - name: Checkout repository\n        uses: actions/checkout@v4\n\n      - name: Log into Docker\n        uses: docker/login-action@v3\n        with:\n          username: ${{ secrets.DOCKER_USERNAME }}\n          password: ${{ secrets.DOCKER_TOKEN }}\n\n        # NOTE: bash is supported on Windows runners\n        # https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#setting-an-output-parameter\n      - name: Tag Version\n        id: ref\n        shell: bash\n        run: |\n          TAG=${{ github.ref_name }}\n          echo \"TAG=${TAG#v}\" >> \"$GITHUB_OUTPUT\"\n\n        # Buildx is not supported on Windows yet.\n      - name: windowsservercore-ltsc${{ matrix.ltsc }}\n        shell: pwsh\n        run: |\n          docker build `\n            --tag \"${{ env.IMAGE_NAME }}:${{ steps.ref.outputs.TAG }}-windowsservercore-ltsc${{ matrix.ltsc }}\" `\n            ./${{ matrix.version }}/windowsservercore-ltsc${{ matrix.ltsc }}\n\n          docker push \"${{ env.IMAGE_NAME }}:${{ steps.ref.outputs.TAG }}-windowsservercore-ltsc${{ matrix.ltsc }}\"\n\n      - name: nanoserver-ltsc${{ matrix.ltsc }}\n        shell: pwsh\n        run: |\n          docker build `\n            --file ./${{ matrix.version }}/nanoserver-ltsc${{ matrix.ltsc }}/Dockerfile.preview `\n            --build-arg \"BASE_IMAGE=${{ env.IMAGE_NAME }}:${{ steps.ref.outputs.TAG }}-windowsservercore-ltsc${{ matrix.ltsc }}\" `\n            --tag \"${{ env.IMAGE_NAME }}:${{ steps.ref.outputs.TAG }}-nanoserver-ltsc${{ matrix.ltsc }}\" `\n            ./${{ matrix.version }}/nanoserver-ltsc${{ matrix.ltsc }}\n\n          docker push \"${{ env.IMAGE_NAME }}:${{ steps.ref.outputs.TAG }}-nanoserver-ltsc${{ matrix.ltsc }}\"\n"
  },
  {
    "path": ".github/workflows/main.yaml",
    "content": "name: Docker build testing\non: [push, pull_request]\n\npermissions:\n  contents: read\n\njobs:\n  linux:\n    name: Test Linux (${{ matrix.version }})\n    runs-on: ubuntu-latest\n    strategy:\n      fail-fast: false\n      matrix:\n        version:\n          - 2.10.x\n          - 2.11.x\n          - 2.12.x\n          - 2.14.x\n    steps:\n      - name: Checkout code\n        uses: actions/checkout@v1\n      - name: Build ${{ matrix.version }} images\n        run: |\n          cd ./${{ matrix.version }}/tests && ./build-images.sh\n      - name: Test ${{ matrix.version }} images\n        run: |\n          cd ./${{ matrix.version }}/tests && ./run-images.sh\n\n  windows:\n    name: Test Windows Server LTSC ${{ matrix.ltsc }} (${{ matrix.version }})\n    runs-on: windows-${{ matrix.ltsc }}\n    strategy:\n      fail-fast: false\n      matrix:\n        version:\n          - 2.10.x\n          - 2.11.x\n          - 2.12.x\n          - 2.14.x\n        ltsc:\n          - 2022\n          # - 2025\n    steps:\n      - name: Checkout code\n        uses: actions/checkout@v1\n      - name: Build images\n        shell: powershell\n        run: |\n          cd ./${{ matrix.version }}/tests; ./build-images-ltsc${{ matrix.ltsc }}.ps1\n      - name: Test images\n        shell: powershell\n        run: |\n          cd ./${{ matrix.version }}/tests; ./run-images-ltsc${{ matrix.ltsc }}.ps1\n"
  },
  {
    "path": "2.10.x/alpine3.22/Dockerfile",
    "content": "FROM alpine:3.22\n\nENV NATS_SERVER 2.10.29\n\nRUN set -eux; \\\n\tapkArch=\"$(apk --print-arch)\"; \\\n\tcase \"$apkArch\" in \\\n\t\taarch64) natsArch='arm64'; sha256='da4b27942ecfb4c5f0c54553d2e7f470ddda9d7581cfe8131b351a0e223ed401' ;; \\\n\t\tarmhf) natsArch='arm6'; sha256='7b70fd23bfbd9efa7ca5edb5aa18fe33b07ff993ac86db06372af297bfaf6fab' ;; \\\n\t\tarmv7) natsArch='arm7'; sha256='a59e7336a32ef78b0ca8bc3e6707a5770461d3f45c4c2f96cfef263f26eaefd5' ;; \\\n\t\tx86_64) natsArch='amd64'; sha256='e314da74a83a1d3876db8814c27eb990fe729640fd6452025b441bcede8390da' ;; \\\n\t\tx86) natsArch='386'; sha256='abc385394c19784558f7aa2f9770fe2daceb22cf95e3fa398c832590479396b0' ;; \\\n\t\ts390x) natsArch='s390x'; sha256='ee821b1eae8bb98a0d4603510a41613dd15afef244261a79da33515699d1aece' ;; \\\n\t\tppc64le) natsArch='ppc64le'; sha256='31b0063d261e5d8c59396f8a3f9298ad80b36fd4bc370ce59e5d160f55a0fe46' ;; \\\n\t\t*) echo >&2 \"error: $apkArch is not supported!\"; exit 1 ;; \\\n\tesac; \\\n\t\\\n\twget -O nats-server.tar.gz \"https://github.com/nats-io/nats-server/releases/download/v${NATS_SERVER}/nats-server-v${NATS_SERVER}-linux-${natsArch}.tar.gz\"; \\\n\techo \"${sha256} *nats-server.tar.gz\" | sha256sum -c -; \\\n\t\\\n\tapk add --no-cache ca-certificates tzdata; \\\n\t\\\n\ttar -xf nats-server.tar.gz; \\\n\trm nats-server.tar.gz; \\\n\tmv \"nats-server-v${NATS_SERVER}-linux-${natsArch}/nats-server\" /usr/local/bin; \\\n\trm -rf \"nats-server-v${NATS_SERVER}-linux-${natsArch}\";\n\nCOPY nats-server.conf /etc/nats/nats-server.conf\nCOPY docker-entrypoint.sh /usr/local/bin\n\nEXPOSE 4222 8222 6222\nENTRYPOINT [\"docker-entrypoint.sh\"]\nCMD [\"nats-server\", \"--config\", \"/etc/nats/nats-server.conf\"]\n"
  },
  {
    "path": "2.10.x/alpine3.22/docker-entrypoint.sh",
    "content": "#!/bin/sh\nset -e\n\n# this if will check if the first argument is a flag\n# but only works if all arguments require a hyphenated flag\n# -v; -SL; -f arg; etc will work, but not arg1 arg2\nif [ \"$#\" -eq 0 ] || [ \"${1#-}\" != \"$1\" ]; then\n    set -- nats-server \"$@\"\nfi\n\n# else default to run whatever the user wanted like \"bash\" or \"sh\"\nexec \"$@\"\n\n"
  },
  {
    "path": "2.10.x/alpine3.22/nats-server.conf",
    "content": "# Client port of 4222 on all interfaces\nport: 4222\n\n# HTTP monitoring port\nmonitor_port: 8222\n\n# This is for clustering multiple servers together.\ncluster {\n  # It is recommended to set a cluster name\n  name: \"my_cluster\"\n\n  # Route connections to be received on any interface on port 6222\n  port: 6222\n\n  # Routes are protected, so need to use them with --routes flag\n  # e.g. --routes=nats-route://ruser:T0pS3cr3t@otherdockerhost:6222\n  authorization {\n    user: ruser\n    password: T0pS3cr3t\n    timeout: 2\n  }\n\n  # Routes are actively solicited and connected to from this server.\n  # This Docker image has none by default, but you can pass a\n  # flag to the nats-server docker image to create one to an existing server.\n  routes = []\n}\n"
  },
  {
    "path": "2.10.x/nanoserver-ltsc2022/Dockerfile",
    "content": "FROM mcr.microsoft.com/windows/nanoserver:ltsc2022\nENV NATS_DOCKERIZED 1\n\nCOPY --from=nats:2.10.29-windowsservercore-ltsc2022 C:\\\\nats-server.exe C:\\\\nats-server.exe\nCOPY nats-server.conf C:\\\\nats-server.conf\n\nEXPOSE 4222 8222 6222\nENTRYPOINT [\"C:\\\\nats-server.exe\"]\nCMD [\"--config\", \"nats-server.conf\"]\n"
  },
  {
    "path": "2.10.x/nanoserver-ltsc2022/Dockerfile.preview",
    "content": "ARG BASE_IMAGE=nats:2.10.29-windowsservercore-ltsc2022\nFROM $BASE_IMAGE AS base\n\nFROM mcr.microsoft.com/windows/nanoserver:ltsc2022\nENV NATS_DOCKERIZED 1\n\nCOPY --from=base C:\\\\nats-server.exe C:\\\\nats-server.exe\nCOPY nats-server.conf C:\\\\nats-server.conf\n\nEXPOSE 4222 8222 6222\nENTRYPOINT [\"C:\\\\nats-server.exe\"]\nCMD [\"--config\", \"nats-server.conf\"]\n"
  },
  {
    "path": "2.10.x/nanoserver-ltsc2022/nats-server.conf",
    "content": "# Client port of 4222 on all interfaces\nport: 4222\n\n# HTTP monitoring port\nmonitor_port: 8222\n\n# This is for clustering multiple servers together.\ncluster {\n  # It is recommended to set a cluster name\n  name: \"my_cluster\"\n\n  # Route connections to be received on any interface on port 6222\n  port: 6222\n\n  # Routes are protected, so need to use them with --routes flag\n  # e.g. --routes=nats-route://ruser:T0pS3cr3t@otherdockerhost:6222\n  authorization {\n    user: ruser\n    password: T0pS3cr3t\n    timeout: 2\n  }\n\n  # Routes are actively solicited and connected to from this server.\n  # This Docker image has none by default, but you can pass a\n  # flag to the nats-server docker image to create one to an existing server.\n  routes = []\n}\n"
  },
  {
    "path": "2.10.x/nanoserver-ltsc2025/Dockerfile",
    "content": "FROM mcr.microsoft.com/windows/nanoserver:ltsc2025\nENV NATS_DOCKERIZED 1\n\nCOPY --from=nats:2.10.29-windowsservercore-ltsc2025 C:\\\\nats-server.exe C:\\\\nats-server.exe\nCOPY nats-server.conf C:\\\\nats-server.conf\n\nEXPOSE 4222 8222 6222\nENTRYPOINT [\"C:\\\\nats-server.exe\"]\nCMD [\"--config\", \"nats-server.conf\"]\n"
  },
  {
    "path": "2.10.x/nanoserver-ltsc2025/Dockerfile.preview",
    "content": "ARG BASE_IMAGE=nats:2.10.29-windowsservercore-ltsc2025\nFROM $BASE_IMAGE AS base\n\nFROM mcr.microsoft.com/windows/nanoserver:ltsc2025\nENV NATS_DOCKERIZED 1\n\nCOPY --from=base C:\\\\nats-server.exe C:\\\\nats-server.exe\nCOPY nats-server.conf C:\\\\nats-server.conf\n\nEXPOSE 4222 8222 6222\nENTRYPOINT [\"C:\\\\nats-server.exe\"]\nCMD [\"--config\", \"nats-server.conf\"]\n"
  },
  {
    "path": "2.10.x/nanoserver-ltsc2025/nats-server.conf",
    "content": "# Client port of 4222 on all interfaces\nport: 4222\n\n# HTTP monitoring port\nmonitor_port: 8222\n\n# This is for clustering multiple servers together.\ncluster {\n  # It is recommended to set a cluster name\n  name: \"my_cluster\"\n\n  # Route connections to be received on any interface on port 6222\n  port: 6222\n\n  # Routes are protected, so need to use them with --routes flag\n  # e.g. --routes=nats-route://ruser:T0pS3cr3t@otherdockerhost:6222\n  authorization {\n    user: ruser\n    password: T0pS3cr3t\n    timeout: 2\n  }\n\n  # Routes are actively solicited and connected to from this server.\n  # This Docker image has none by default, but you can pass a\n  # flag to the nats-server docker image to create one to an existing server.\n  routes = []\n}\n"
  },
  {
    "path": "2.10.x/scratch/Dockerfile",
    "content": "FROM scratch\nENV PATH=\"$PATH:/\"\n\nCOPY --from=nats:2.10.29-alpine3.22 /usr/local/bin/nats-server /nats-server\nCOPY nats-server.conf /nats-server.conf\n\nEXPOSE 4222 8222 6222\nENTRYPOINT [\"/nats-server\"]\nCMD [\"--config\", \"nats-server.conf\"]\n"
  },
  {
    "path": "2.10.x/scratch/Dockerfile.preview",
    "content": "ARG BASE_IMAGE=nats:2.10.29-alpine3.22\nFROM $BASE_IMAGE AS base\n\nFROM scratch\nENV PATH=\"$PATH:/\"\n\nCOPY --from=base /usr/local/bin/nats-server /nats-server\nCOPY nats-server.conf /nats-server.conf\n\nEXPOSE 4222 8222 6222\nENTRYPOINT [\"/nats-server\"]\nCMD [\"--config\", \"nats-server.conf\"]\n"
  },
  {
    "path": "2.10.x/scratch/nats-server.conf",
    "content": "# Client port of 4222 on all interfaces\nport: 4222\n\n# HTTP monitoring port\nmonitor_port: 8222\n\n# This is for clustering multiple servers together.\ncluster {\n  # It is recommended to set a cluster name\n  name: \"my_cluster\"\n\n  # Route connections to be received on any interface on port 6222\n  port: 6222\n\n  # Routes are protected, so need to use them with --routes flag\n  # e.g. --routes=nats-route://ruser:T0pS3cr3t@otherdockerhost:6222\n  authorization {\n    user: ruser\n    password: T0pS3cr3t\n    timeout: 2\n  }\n\n  # Routes are actively solicited and connected to from this server.\n  # This Docker image has none by default, but you can pass a\n  # flag to the nats-server docker image to create one to an existing server.\n  routes = []\n}\n"
  },
  {
    "path": "2.10.x/tests/build-images-ltsc2022.ps1",
    "content": "# Show statements as they run.\nSet-PSDebug -Trace 2\n# Exit on error.\n$ErrorActionPreference = \"Stop\"\n\n$ver = 'NATS_SERVER 2.10.29'.Split(' ')[1]\n\nWrite-Output '-- host info ---'\nWrite-Output $PSVersionTable\nWrite-Output (Get-WMIObject win32_operatingsystem).name\nWrite-Output (Get-WMIObject win32_operatingsystem).OSArchitecture\n\n# The windowsservercore images must be built before the nanoserver images.\ncd \"../windowsservercore-ltsc2022\"\nWrite-Host \"building windowsservercore-ltsc2022\"\ndocker build --tag \"nats:${ver}-windowsservercore-ltsc2022\" .\nif ($LASTEXITCODE -ne 0) {\n    exit 1\n}\n\ncd \"../nanoserver-ltsc2022\"\nWrite-Host \"building nanoserver-ltsc2022\"\ndocker build --tag \"nats:${ver}-nanoserver-ltsc2022\" .\nif ($LASTEXITCODE -ne 0) {\n    exit 1\n}\n\ndocker images\n"
  },
  {
    "path": "2.10.x/tests/build-images-ltsc2025.ps1",
    "content": "# Show statements as they run.\nSet-PSDebug -Trace 2\n# Exit on error.\n$ErrorActionPreference = \"Stop\"\n\n$ver = 'NATS_SERVER 2.10.29'.Split(' ')[1]\n\nWrite-Output '-- host info ---'\nWrite-Output $PSVersionTable\nWrite-Output (Get-WMIObject win32_operatingsystem).name\nWrite-Output (Get-WMIObject win32_operatingsystem).OSArchitecture\n\n# The windowsservercore images must be built before the nanoserver images.\ncd \"../windowsservercore-ltsc2025\"\nWrite-Host \"building windowsservercore-ltsc2025\"\ndocker build --tag \"nats:${ver}-windowsservercore-ltsc2025\" .\nif ($LASTEXITCODE -ne 0) {\n    exit 1\n}\n\ncd \"../nanoserver-ltsc2025\"\nWrite-Host \"building nanoserver-ltsc2025\"\ndocker build --tag \"nats:${ver}-nanoserver-ltsc2025\" .\nif ($LASTEXITCODE -ne 0) {\n    exit 1\n}\n\ndocker images\n"
  },
  {
    "path": "2.10.x/tests/build-images.sh",
    "content": "#!/usr/bin/env bash\nset -ex\n\nver=(NATS_SERVER 2.10.29)\n\n(\n\tcd \"../alpine3.22\"\n\tdocker build --tag nats:${ver[1]}-alpine3.22 .\n)\n\n(\n\tcd \"../scratch\"\n\tdocker build --tag nats:${ver[1]}-scratch .\n)\n"
  },
  {
    "path": "2.10.x/tests/run-images-ltsc2022.ps1",
    "content": "# Show statements as they run.\nSet-PSDebug -Trace 2\n# Exit on error.\n$ErrorActionPreference = \"Stop\"\n\n$ver = \"NATS_SERVER 2.10.29\".Split(\" \")[1]\n\n$images = @(\n\t\"nats:${ver}-windowsservercore-ltsc2022\",\n\t\"nats:${ver}-nanoserver-ltsc2022\"\n)\n\nforeach ($img in $images) {\n\tWrite-Output \"running ${img}\"\n\t$runId = & docker run --detach \"${img}\"\n\tsleep 1\n\n\tWrite-Output \"checking ${img}\"\n\tdocker ps --filter \"id=${runId}\" --filter \"status=running\" --quiet\n\tif ($LASTEXITCODE -ne 0) {\n\t\texit 1\n\t}\n\tdocker kill $runId\n}\n"
  },
  {
    "path": "2.10.x/tests/run-images-ltsc2025.ps1",
    "content": "# Show statements as they run.\nSet-PSDebug -Trace 2\n# Exit on error.\n$ErrorActionPreference = \"Stop\"\n\n$ver = \"NATS_SERVER 2.10.29\".Split(\" \")[1]\n\n$images = @(\n\t\"nats:${ver}-windowsservercore-ltsc2025\",\n\t\"nats:${ver}-nanoserver-ltsc2025\"\n)\n\nforeach ($img in $images) {\n\tWrite-Output \"running ${img}\"\n\t$runId = & docker run --detach \"${img}\"\n\tsleep 1\n\n\tWrite-Output \"checking ${img}\"\n\tdocker logs \"$runId\"\n\tdocker ps --filter \"id=${runId}\" --filter \"status=running\" --quiet\n\tif ($LASTEXITCODE -ne 0) {\n\t\texit 1\n\t}\n\tdocker kill $runId\n}\n"
  },
  {
    "path": "2.10.x/tests/run-images.sh",
    "content": "#!/usr/bin/env bash\nset -ex\n\nver=(NATS_SERVER 2.10.29)\n\nimages=(\n\t\"nats:${ver[1]}-alpine3.22\"\n\t\"nats:${ver[1]}-scratch\"\n)\n\nfor img in \"${images[@]}\"; do\n\trun_id=$(docker run --detach \"${img}\")\n\tsleep 1\n\ttest -n \"$(docker ps --filter \"id=${run_id}\" --filter \"status=running\" --quiet)\"\n\tdocker kill \"$run_id\"\ndone\n"
  },
  {
    "path": "2.10.x/windowsservercore-ltsc2022/Dockerfile",
    "content": "FROM mcr.microsoft.com/windows/servercore:ltsc2022\n\n# Enable exit on error.\nSHELL [\"powershell\", \"-Command\", \"$ErrorActionPreference = 'Stop';\"]\n\nENV NATS_DOCKERIZED 1\nENV NATS_SERVER 2.10.29\nENV NATS_SERVER_DOWNLOAD https://github.com/nats-io/nats-server/releases/download/v${NATS_SERVER}/nats-server-v${NATS_SERVER}-windows-amd64.zip\nENV NATS_SERVER_SHASUM 98657bf4d5a9ce44168c019ba6894cda8e22e6adc8798edc05c168db7262de29\n\nRUN Set-PSDebug -Trace 2\n\nRUN Write-Host ('downloading from {0} ...' -f $env:NATS_SERVER_DOWNLOAD); \\\n\t[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \\\n\tInvoke-WebRequest -Uri $env:NATS_SERVER_DOWNLOAD -OutFile nats.zip; \\\n\t\\\n\tWrite-Host ('verifying sha256 ({0}) ...' -f $env:NATS_SERVER_SHASUM); \\\n\tif ((Get-FileHash nats.zip -Algorithm sha256).Hash -ne $env:NATS_SERVER_SHASUM) { \\\n\t\tWrite-Host 'FAILED!'; \\\n\t\texit 1; \\\n\t}; \\\n\tWrite-Host 'extracting nats.zip'; \\\n\tExpand-Archive -Path 'nats.zip' -DestinationPath .; \\\n\t\\\n\tWrite-Host 'copying binary'; \\\n\tCopy-Item nats-server-v*/nats-server.exe -Destination C:\\\\nats-server.exe; \\\n\t\\\n\tWrite-Host 'cleaning up'; \\\n\tRemove-Item -Force nats.zip; \\\n\tRemove-Item -Recurse -Force nats-server-v*; \\\n\t\\\n\tWrite-Host 'complete.';\n\nCOPY nats-server.conf C:\\\\nats-server.conf\n\nEXPOSE 4222 8222 6222\nENTRYPOINT [\"C:\\\\nats-server.exe\"]\nCMD [\"--config\", \"nats-server.conf\"]\n"
  },
  {
    "path": "2.10.x/windowsservercore-ltsc2022/nats-server.conf",
    "content": "# Client port of 4222 on all interfaces\nport: 4222\n\n# HTTP monitoring port\nmonitor_port: 8222\n\n# This is for clustering multiple servers together.\ncluster {\n  # It is recommended to set a cluster name\n  name: \"my_cluster\"\n\n  # Route connections to be received on any interface on port 6222\n  port: 6222\n\n  # Routes are protected, so need to use them with --routes flag\n  # e.g. --routes=nats-route://ruser:T0pS3cr3t@otherdockerhost:6222\n  authorization {\n    user: ruser\n    password: T0pS3cr3t\n    timeout: 2\n  }\n\n  # Routes are actively solicited and connected to from this server.\n  # This Docker image has none by default, but you can pass a\n  # flag to the nats-server docker image to create one to an existing server.\n  routes = []\n}\n"
  },
  {
    "path": "2.10.x/windowsservercore-ltsc2025/Dockerfile",
    "content": "FROM mcr.microsoft.com/windows/servercore:ltsc2025\n\n# Enable exit on error.\nSHELL [\"powershell\", \"-Command\", \"$ErrorActionPreference = 'Stop';\"]\n\nENV NATS_DOCKERIZED 1\nENV NATS_SERVER 2.10.29\nENV NATS_SERVER_DOWNLOAD https://github.com/nats-io/nats-server/releases/download/v${NATS_SERVER}/nats-server-v${NATS_SERVER}-windows-amd64.zip\nENV NATS_SERVER_SHASUM 98657bf4d5a9ce44168c019ba6894cda8e22e6adc8798edc05c168db7262de29\n\nRUN Set-PSDebug -Trace 2\n\nRUN Write-Host ('downloading from {0} ...' -f $env:NATS_SERVER_DOWNLOAD); \\\n    [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \\\n    Invoke-WebRequest -Uri $env:NATS_SERVER_DOWNLOAD -OutFile nats.zip; \\\n    \\\n    Write-Host ('verifying sha256 ({0}) ...' -f $env:NATS_SERVER_SHASUM); \\\n    if ((Get-FileHash nats.zip -Algorithm sha256).Hash -ne $env:NATS_SERVER_SHASUM) { \\\n    Write-Host 'FAILED!'; \\\n    exit 1; \\\n    }; \\\n    Write-Host 'extracting nats.zip'; \\\n    Expand-Archive -Path 'nats.zip' -DestinationPath .; \\\n    \\\n    Write-Host 'copying binary'; \\\n    Copy-Item nats-server-v*/nats-server.exe -Destination C:\\\\nats-server.exe; \\\n    \\\n    Write-Host 'cleaning up'; \\\n    Remove-Item -Force nats.zip; \\\n    Remove-Item -Recurse -Force nats-server-v*; \\\n    \\\n    Write-Host 'complete.';\n\nCOPY nats-server.conf C:\\\\nats-server.conf\n\nEXPOSE 4222 8222 6222\nENTRYPOINT [\"C:\\\\nats-server.exe\"]\nCMD [\"--config\", \"nats-server.conf\"]\n"
  },
  {
    "path": "2.10.x/windowsservercore-ltsc2025/nats-server.conf",
    "content": "# Client port of 4222 on all interfaces\nport: 4222\n\n# HTTP monitoring port\nmonitor_port: 8222\n\n# This is for clustering multiple servers together.\ncluster {\n  # It is recommended to set a cluster name\n  name: \"my_cluster\"\n\n  # Route connections to be received on any interface on port 6222\n  port: 6222\n\n  # Routes are protected, so need to use them with --routes flag\n  # e.g. --routes=nats-route://ruser:T0pS3cr3t@otherdockerhost:6222\n  authorization {\n    user: ruser\n    password: T0pS3cr3t\n    timeout: 2\n  }\n\n  # Routes are actively solicited and connected to from this server.\n  # This Docker image has none by default, but you can pass a\n  # flag to the nats-server docker image to create one to an existing server.\n  routes = []\n}\n"
  },
  {
    "path": "2.11.x/alpine3.22/Dockerfile",
    "content": "FROM alpine:3.22\n\nENV NATS_SERVER 2.11.17\n\nLABEL org.opencontainers.image.title=\"NATS Server\" \\\n      org.opencontainers.image.description=\"NATS is an open-source, high-performance, cloud native messaging system.\" \\\n      org.opencontainers.image.url=\"https://nats.io\" \\\n      org.opencontainers.image.documentation=\"https://docs.nats.io\" \\\n      org.opencontainers.image.source=\"https://github.com/nats-io/nats-docker\" \\\n      org.opencontainers.image.vendor=\"NATS.io\" \\\n      org.opencontainers.image.licenses=\"Apache-2.0\" \\\n      org.opencontainers.image.version=\"${NATS_SERVER}\"\n\nRUN set -eux; \\\n    apkArch=\"$(apk --print-arch)\"; \\\n    case \"$apkArch\" in \\\n    aarch64) natsArch='arm64'; sha256='d21df24f262f34f8bf6d1f0bca557c08429e433fd9f60f6983105539ae517feb' ;; \\\n    armhf) natsArch='arm6'; sha256='13e090f2f433d31f1408543ef52204108eb1fcee4ac74b839a3f2f0b72aceade' ;; \\\n    armv7) natsArch='arm7'; sha256='5c1f445095ea9a455d6dd092967d20dd38c6bc8c4da13d108e7d3a1386ca3c7d' ;; \\\n    x86_64) natsArch='amd64'; sha256='ad608dd0ea8bbfa58c40e3b8f58ed67478eec26166ec49c502db8d17589b51b5' ;; \\\n    x86) natsArch='386'; sha256='6bfe7637dd61b9386074294c37c0790061feb39fd5198c34f9d1882c94926d5d' ;; \\\n    s390x) natsArch='s390x'; sha256='4e19f27f2ee5f2fe9a5480d6b4541b63f58934524c14b839b2d4d32459ca91bc' ;; \\\n    ppc64le) natsArch='ppc64le'; sha256='822e7a6ab51dca0cda69a3dc274ecf058f4502265984d09d9b45ab13b749a4f3' ;; \\\n    loong64) natsArch='loong64'; sha256='c410deb61bcad2e39739e4cc4d2a7d8cd84bb17d655d4a1e97a92c98cd309e6f' ;; \\\n    *) echo >&2 \"error: $apkArch is not supported!\"; exit 1 ;; \\\n    esac; \\\n    \\\n    wget -O nats-server.tar.gz \"https://github.com/nats-io/nats-server/releases/download/v${NATS_SERVER}/nats-server-v${NATS_SERVER}-linux-${natsArch}.tar.gz\"; \\\n    echo \"${sha256} *nats-server.tar.gz\" | sha256sum -c -; \\\n    \\\n    apk add --no-cache ca-certificates tzdata; \\\n    \\\n    tar -xf nats-server.tar.gz; \\\n    rm nats-server.tar.gz; \\\n    mv \"nats-server-v${NATS_SERVER}-linux-${natsArch}/nats-server\" /usr/local/bin; \\\n    rm -rf \"nats-server-v${NATS_SERVER}-linux-${natsArch}\";\n\nCOPY nats-server.conf /etc/nats/nats-server.conf\nCOPY docker-entrypoint.sh /usr/local/bin\n\nEXPOSE 4222 8222 6222\nENTRYPOINT [\"docker-entrypoint.sh\"]\nCMD [\"nats-server\", \"--config\", \"/etc/nats/nats-server.conf\"]\n"
  },
  {
    "path": "2.11.x/alpine3.22/docker-entrypoint.sh",
    "content": "#!/bin/sh\nset -e\n\n# this if will check if the first argument is a flag\n# but only works if all arguments require a hyphenated flag\n# -v; -SL; -f arg; etc will work, but not arg1 arg2\nif [ \"$#\" -eq 0 ] || [ \"${1#-}\" != \"$1\" ]; then\n    set -- nats-server \"$@\"\nfi\n\n# else default to run whatever the user wanted like \"bash\" or \"sh\"\nexec \"$@\"\n\n"
  },
  {
    "path": "2.11.x/alpine3.22/nats-server.conf",
    "content": "# Client port of 4222 on all interfaces\nport: 4222\n\n# HTTP monitoring port\nmonitor_port: 8222\n\n# This is for clustering multiple servers together.\ncluster {\n  # It is recommended to set a cluster name\n  name: \"my_cluster\"\n\n  # Route connections to be received on any interface on port 6222\n  port: 6222\n\n  # Routes are protected, so need to use them with --routes flag\n  # e.g. --routes=nats-route://ruser:T0pS3cr3t@otherdockerhost:6222\n  authorization {\n    user: ruser\n    password: T0pS3cr3t\n    timeout: 2\n  }\n\n  # Routes are actively solicited and connected to from this server.\n  # This Docker image has none by default, but you can pass a\n  # flag to the nats-server docker image to create one to an existing server.\n  routes = []\n}\n"
  },
  {
    "path": "2.11.x/nanoserver-ltsc2022/Dockerfile",
    "content": "FROM mcr.microsoft.com/windows/nanoserver:ltsc2022\nENV NATS_DOCKERIZED 1\n\nCOPY --from=nats:2.11.17-windowsservercore-ltsc2022 C:\\\\nats-server.exe C:\\\\nats-server.exe\nCOPY nats-server.conf C:\\\\nats-server.conf\n\nEXPOSE 4222 8222 6222\nENTRYPOINT [\"C:\\\\nats-server.exe\"]\nCMD [\"--config\", \"nats-server.conf\"]\n"
  },
  {
    "path": "2.11.x/nanoserver-ltsc2022/Dockerfile.preview",
    "content": "ARG BASE_IMAGE=nats:2.11.17-windowsservercore-ltsc2022\nFROM $BASE_IMAGE AS base\n\nFROM mcr.microsoft.com/windows/nanoserver:ltsc2022\nENV NATS_DOCKERIZED 1\n\nCOPY --from=base C:\\\\nats-server.exe C:\\\\nats-server.exe\nCOPY nats-server.conf C:\\\\nats-server.conf\n\nEXPOSE 4222 8222 6222\nENTRYPOINT [\"C:\\\\nats-server.exe\"]\nCMD [\"--config\", \"nats-server.conf\"]\n"
  },
  {
    "path": "2.11.x/nanoserver-ltsc2022/nats-server.conf",
    "content": "# Client port of 4222 on all interfaces\nport: 4222\n\n# HTTP monitoring port\nmonitor_port: 8222\n\n# This is for clustering multiple servers together.\ncluster {\n  # It is recommended to set a cluster name\n  name: \"my_cluster\"\n\n  # Route connections to be received on any interface on port 6222\n  port: 6222\n\n  # Routes are protected, so need to use them with --routes flag\n  # e.g. --routes=nats-route://ruser:T0pS3cr3t@otherdockerhost:6222\n  authorization {\n    user: ruser\n    password: T0pS3cr3t\n    timeout: 2\n  }\n\n  # Routes are actively solicited and connected to from this server.\n  # This Docker image has none by default, but you can pass a\n  # flag to the nats-server docker image to create one to an existing server.\n  routes = []\n}\n"
  },
  {
    "path": "2.11.x/nanoserver-ltsc2025/Dockerfile",
    "content": "FROM mcr.microsoft.com/windows/nanoserver:ltsc2025\nENV NATS_DOCKERIZED 1\n\nCOPY --from=nats:2.11.17-windowsservercore-ltsc2025 C:\\\\nats-server.exe C:\\\\nats-server.exe\nCOPY nats-server.conf C:\\\\nats-server.conf\n\nEXPOSE 4222 8222 6222\nENTRYPOINT [\"C:\\\\nats-server.exe\"]\nCMD [\"--config\", \"nats-server.conf\"]\n"
  },
  {
    "path": "2.11.x/nanoserver-ltsc2025/Dockerfile.preview",
    "content": "ARG BASE_IMAGE=nats:2.11.17-windowsservercore-ltsc2025\nFROM $BASE_IMAGE AS base\n\nFROM mcr.microsoft.com/windows/nanoserver:ltsc2025\nENV NATS_DOCKERIZED 1\n\nCOPY --from=base C:\\\\nats-server.exe C:\\\\nats-server.exe\nCOPY nats-server.conf C:\\\\nats-server.conf\n\nEXPOSE 4222 8222 6222\nENTRYPOINT [\"C:\\\\nats-server.exe\"]\nCMD [\"--config\", \"nats-server.conf\"]\n"
  },
  {
    "path": "2.11.x/nanoserver-ltsc2025/nats-server.conf",
    "content": "# Client port of 4222 on all interfaces\nport: 4222\n\n# HTTP monitoring port\nmonitor_port: 8222\n\n# This is for clustering multiple servers together.\ncluster {\n  # It is recommended to set a cluster name\n  name: \"my_cluster\"\n\n  # Route connections to be received on any interface on port 6222\n  port: 6222\n\n  # Routes are protected, so need to use them with --routes flag\n  # e.g. --routes=nats-route://ruser:T0pS3cr3t@otherdockerhost:6222\n  authorization {\n    user: ruser\n    password: T0pS3cr3t\n    timeout: 2\n  }\n\n  # Routes are actively solicited and connected to from this server.\n  # This Docker image has none by default, but you can pass a\n  # flag to the nats-server docker image to create one to an existing server.\n  routes = []\n}\n"
  },
  {
    "path": "2.11.x/scratch/Dockerfile",
    "content": "FROM scratch\nENV PATH=\"$PATH:/\"\n\nCOPY --from=nats:2.11.17-alpine3.22 /usr/local/bin/nats-server /nats-server\nCOPY nats-server.conf /nats-server.conf\n\nEXPOSE 4222 8222 6222\nENTRYPOINT [\"/nats-server\"]\nCMD [\"--config\", \"nats-server.conf\"]\n"
  },
  {
    "path": "2.11.x/scratch/Dockerfile.preview",
    "content": "ARG BASE_IMAGE=nats:2.11.17-alpine3.22\nFROM $BASE_IMAGE AS base\n\nFROM scratch\nENV PATH=\"$PATH:/\"\n\nCOPY --from=base /usr/local/bin/nats-server /nats-server\nCOPY nats-server.conf /nats-server.conf\n\nEXPOSE 4222 8222 6222\nENTRYPOINT [\"/nats-server\"]\nCMD [\"--config\", \"nats-server.conf\"]\n"
  },
  {
    "path": "2.11.x/scratch/nats-server.conf",
    "content": "# Client port of 4222 on all interfaces\nport: 4222\n\n# HTTP monitoring port\nmonitor_port: 8222\n\n# This is for clustering multiple servers together.\ncluster {\n  # It is recommended to set a cluster name\n  name: \"my_cluster\"\n\n  # Route connections to be received on any interface on port 6222\n  port: 6222\n\n  # Routes are protected, so need to use them with --routes flag\n  # e.g. --routes=nats-route://ruser:T0pS3cr3t@otherdockerhost:6222\n  authorization {\n    user: ruser\n    password: T0pS3cr3t\n    timeout: 2\n  }\n\n  # Routes are actively solicited and connected to from this server.\n  # This Docker image has none by default, but you can pass a\n  # flag to the nats-server docker image to create one to an existing server.\n  routes = []\n}\n"
  },
  {
    "path": "2.11.x/tests/build-images-ltsc2022.ps1",
    "content": "# Show statements as they run.\nSet-PSDebug -Trace 2\n# Exit on error.\n$ErrorActionPreference = \"Stop\"\n\n$ver = 'NATS_SERVER 2.11.17'.Split(' ')[1]\n\nWrite-Output '-- host info ---'\nWrite-Output $PSVersionTable\nWrite-Output (Get-WMIObject win32_operatingsystem).name\nWrite-Output (Get-WMIObject win32_operatingsystem).OSArchitecture\n\n# The windowsservercore images must be built before the nanoserver images.\ncd \"../windowsservercore-ltsc2022\"\nWrite-Host \"building windowsservercore-ltsc2022\"\ndocker build --tag \"nats:${ver}-windowsservercore-ltsc2022\" .\nif ($LASTEXITCODE -ne 0) {\n    exit 1\n}\n\ncd \"../nanoserver-ltsc2022\"\nWrite-Host \"building nanoserver-ltsc2022\"\ndocker build --tag \"nats:${ver}-nanoserver-ltsc2022\" .\nif ($LASTEXITCODE -ne 0) {\n    exit 1\n}\n\ndocker images\n"
  },
  {
    "path": "2.11.x/tests/build-images-ltsc2025.ps1",
    "content": "# Show statements as they run.\nSet-PSDebug -Trace 2\n# Exit on error.\n$ErrorActionPreference = \"Stop\"\n\n$ver = 'NATS_SERVER 2.11.17'.Split(' ')[1]\n\nWrite-Output '-- host info ---'\nWrite-Output $PSVersionTable\nWrite-Output (Get-WMIObject win32_operatingsystem).name\nWrite-Output (Get-WMIObject win32_operatingsystem).OSArchitecture\n\n# The windowsservercore images must be built before the nanoserver images.\ncd \"../windowsservercore-ltsc2025\"\nWrite-Host \"building windowsservercore-ltsc2025\"\ndocker build --tag \"nats:${ver}-windowsservercore-ltsc2025\" .\nif ($LASTEXITCODE -ne 0) {\n    exit 1\n}\n\ncd \"../nanoserver-ltsc2025\"\nWrite-Host \"building nanoserver-ltsc2025\"\ndocker build --tag \"nats:${ver}-nanoserver-ltsc2025\" .\nif ($LASTEXITCODE -ne 0) {\n    exit 1\n}\n\ndocker images\n"
  },
  {
    "path": "2.11.x/tests/build-images.sh",
    "content": "#!/usr/bin/env bash\nset -ex\n\nver=(NATS_SERVER 2.11.17)\n\n(\n\tcd \"../alpine3.22\"\n\tdocker build --tag nats:${ver[1]}-alpine3.22 .\n)\n\n(\n\tcd \"../scratch\"\n\tdocker build --tag nats:${ver[1]}-scratch .\n)\n"
  },
  {
    "path": "2.11.x/tests/run-images-ltsc2022.ps1",
    "content": "# Show statements as they run.\nSet-PSDebug -Trace 2\n# Exit on error.\n$ErrorActionPreference = \"Stop\"\n\n$ver = \"NATS_SERVER 2.11.17\".Split(\" \")[1]\n\n$images = @(\n\t\"nats:${ver}-windowsservercore-ltsc2022\",\n\t\"nats:${ver}-nanoserver-ltsc2022\"\n)\n\nforeach ($img in $images) {\n\tWrite-Output \"running ${img}\"\n\t$runId = & docker run --detach \"${img}\"\n\tsleep 1\n\n\tWrite-Output \"checking ${img}\"\n\tdocker ps --filter \"id=${runId}\" --filter \"status=running\" --quiet\n\tif ($LASTEXITCODE -ne 0) {\n\t\texit 1\n\t}\n\tdocker kill $runId\n}\n"
  },
  {
    "path": "2.11.x/tests/run-images-ltsc2025.ps1",
    "content": "# Show statements as they run.\nSet-PSDebug -Trace 2\n# Exit on error.\n$ErrorActionPreference = \"Stop\"\n\n$ver = \"NATS_SERVER 2.11.17\".Split(\" \")[1]\n\n$images = @(\n\t\"nats:${ver}-windowsservercore-ltsc2025\",\n\t\"nats:${ver}-nanoserver-ltsc2025\"\n)\n\nforeach ($img in $images) {\n\tWrite-Output \"running ${img}\"\n\t$runId = & docker run --detach \"${img}\"\n\tsleep 1\n\n\tWrite-Output \"checking ${img}\"\n\tdocker logs \"$runId\"\n\tdocker ps --filter \"id=${runId}\" --filter \"status=running\" --quiet\n\tif ($LASTEXITCODE -ne 0) {\n\t\texit 1\n\t}\n\tdocker kill $runId\n}\n"
  },
  {
    "path": "2.11.x/tests/run-images.sh",
    "content": "#!/usr/bin/env bash\nset -ex\n\nver=(NATS_SERVER 2.11.17)\n\nimages=(\n\t\"nats:${ver[1]}-alpine3.22\"\n\t\"nats:${ver[1]}-scratch\"\n)\n\nfor img in \"${images[@]}\"; do\n\trun_id=$(docker run --detach \"${img}\")\n\tsleep 1\n\ttest -n \"$(docker ps --filter \"id=${run_id}\" --filter \"status=running\" --quiet)\"\n\tdocker kill \"$run_id\"\ndone\n"
  },
  {
    "path": "2.11.x/windowsservercore-ltsc2022/Dockerfile",
    "content": "FROM mcr.microsoft.com/windows/servercore:ltsc2022\n\n# Enable exit on error.\nSHELL [\"powershell\", \"-Command\", \"$ErrorActionPreference = 'Stop';\"]\n\nENV NATS_DOCKERIZED 1\nENV NATS_SERVER 2.11.17\n\nLABEL org.opencontainers.image.title=\"NATS Server\" \\\n      org.opencontainers.image.description=\"NATS is an open-source, high-performance, cloud native messaging system.\" \\\n      org.opencontainers.image.url=\"https://nats.io\" \\\n      org.opencontainers.image.documentation=\"https://docs.nats.io\" \\\n      org.opencontainers.image.source=\"https://github.com/nats-io/nats-docker\" \\\n      org.opencontainers.image.vendor=\"NATS.io\" \\\n      org.opencontainers.image.licenses=\"Apache-2.0\" \\\n      org.opencontainers.image.version=\"${NATS_SERVER}\"\n\nENV NATS_SERVER_DOWNLOAD https://github.com/nats-io/nats-server/releases/download/v${NATS_SERVER}/nats-server-v${NATS_SERVER}-windows-amd64.zip\nENV NATS_SERVER_SHASUM 45c6a61420c87afaa31edf89372b3cfb4335ac12838fc8c593967a4d8b503f5a\n\nRUN Set-PSDebug -Trace 2\n\nRUN Write-Host ('downloading from {0} ...' -f $env:NATS_SERVER_DOWNLOAD); \\\n\t[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \\\n\tInvoke-WebRequest -Uri $env:NATS_SERVER_DOWNLOAD -OutFile nats.zip; \\\n\t\\\n\tWrite-Host ('verifying sha256 ({0}) ...' -f $env:NATS_SERVER_SHASUM); \\\n\tif ((Get-FileHash nats.zip -Algorithm sha256).Hash -ne $env:NATS_SERVER_SHASUM) { \\\n\t\tWrite-Host 'FAILED!'; \\\n\t\texit 1; \\\n\t}; \\\n\tWrite-Host 'extracting nats.zip'; \\\n\tExpand-Archive -Path 'nats.zip' -DestinationPath .; \\\n\t\\\n\tWrite-Host 'copying binary'; \\\n\tCopy-Item nats-server-v*/nats-server.exe -Destination C:\\\\nats-server.exe; \\\n\t\\\n\tWrite-Host 'cleaning up'; \\\n\tRemove-Item -Force nats.zip; \\\n\tRemove-Item -Recurse -Force nats-server-v*; \\\n\t\\\n\tWrite-Host 'complete.';\n\nCOPY nats-server.conf C:\\\\nats-server.conf\n\nEXPOSE 4222 8222 6222\nENTRYPOINT [\"C:\\\\nats-server.exe\"]\nCMD [\"--config\", \"nats-server.conf\"]\n"
  },
  {
    "path": "2.11.x/windowsservercore-ltsc2022/nats-server.conf",
    "content": "# Client port of 4222 on all interfaces\nport: 4222\n\n# HTTP monitoring port\nmonitor_port: 8222\n\n# This is for clustering multiple servers together.\ncluster {\n  # It is recommended to set a cluster name\n  name: \"my_cluster\"\n\n  # Route connections to be received on any interface on port 6222\n  port: 6222\n\n  # Routes are protected, so need to use them with --routes flag\n  # e.g. --routes=nats-route://ruser:T0pS3cr3t@otherdockerhost:6222\n  authorization {\n    user: ruser\n    password: T0pS3cr3t\n    timeout: 2\n  }\n\n  # Routes are actively solicited and connected to from this server.\n  # This Docker image has none by default, but you can pass a\n  # flag to the nats-server docker image to create one to an existing server.\n  routes = []\n}\n"
  },
  {
    "path": "2.11.x/windowsservercore-ltsc2025/Dockerfile",
    "content": "FROM mcr.microsoft.com/windows/servercore:ltsc2025\n\n# Enable exit on error.\nSHELL [\"powershell\", \"-Command\", \"$ErrorActionPreference = 'Stop';\"]\n\nENV NATS_DOCKERIZED 1\nENV NATS_SERVER 2.11.17\n\nLABEL org.opencontainers.image.title=\"NATS Server\" \\\n      org.opencontainers.image.description=\"NATS is an open-source, high-performance, cloud native messaging system.\" \\\n      org.opencontainers.image.url=\"https://nats.io\" \\\n      org.opencontainers.image.documentation=\"https://docs.nats.io\" \\\n      org.opencontainers.image.source=\"https://github.com/nats-io/nats-docker\" \\\n      org.opencontainers.image.vendor=\"NATS.io\" \\\n      org.opencontainers.image.licenses=\"Apache-2.0\" \\\n      org.opencontainers.image.version=\"${NATS_SERVER}\"\n\nENV NATS_SERVER_DOWNLOAD https://github.com/nats-io/nats-server/releases/download/v${NATS_SERVER}/nats-server-v${NATS_SERVER}-windows-amd64.zip\nENV NATS_SERVER_SHASUM 45c6a61420c87afaa31edf89372b3cfb4335ac12838fc8c593967a4d8b503f5a\n\nRUN Set-PSDebug -Trace 2\n\nRUN Write-Host ('downloading from {0} ...' -f $env:NATS_SERVER_DOWNLOAD); \\\n    [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \\\n    Invoke-WebRequest -Uri $env:NATS_SERVER_DOWNLOAD -OutFile nats.zip; \\\n    \\\n    Write-Host ('verifying sha256 ({0}) ...' -f $env:NATS_SERVER_SHASUM); \\\n    if ((Get-FileHash nats.zip -Algorithm sha256).Hash -ne $env:NATS_SERVER_SHASUM) { \\\n    Write-Host 'FAILED!'; \\\n    exit 1; \\\n    }; \\\n    Write-Host 'extracting nats.zip'; \\\n    Expand-Archive -Path 'nats.zip' -DestinationPath .; \\\n    \\\n    Write-Host 'copying binary'; \\\n    Copy-Item nats-server-v*/nats-server.exe -Destination C:\\\\nats-server.exe; \\\n    \\\n    Write-Host 'cleaning up'; \\\n    Remove-Item -Force nats.zip; \\\n    Remove-Item -Recurse -Force nats-server-v*; \\\n    \\\n    Write-Host 'complete.';\n\nCOPY nats-server.conf C:\\\\nats-server.conf\n\nEXPOSE 4222 8222 6222\nENTRYPOINT [\"C:\\\\nats-server.exe\"]\nCMD [\"--config\", \"nats-server.conf\"]\n"
  },
  {
    "path": "2.11.x/windowsservercore-ltsc2025/nats-server.conf",
    "content": "# Client port of 4222 on all interfaces\nport: 4222\n\n# HTTP monitoring port\nmonitor_port: 8222\n\n# This is for clustering multiple servers together.\ncluster {\n  # It is recommended to set a cluster name\n  name: \"my_cluster\"\n\n  # Route connections to be received on any interface on port 6222\n  port: 6222\n\n  # Routes are protected, so need to use them with --routes flag\n  # e.g. --routes=nats-route://ruser:T0pS3cr3t@otherdockerhost:6222\n  authorization {\n    user: ruser\n    password: T0pS3cr3t\n    timeout: 2\n  }\n\n  # Routes are actively solicited and connected to from this server.\n  # This Docker image has none by default, but you can pass a\n  # flag to the nats-server docker image to create one to an existing server.\n  routes = []\n}\n"
  },
  {
    "path": "2.12.x/alpine3.22/Dockerfile",
    "content": "FROM alpine:3.22\n\nENV NATS_SERVER 2.12.9-RC.1\n\nLABEL org.opencontainers.image.title=\"NATS Server\" \\\n      org.opencontainers.image.description=\"NATS is an open-source, high-performance, cloud native messaging system.\" \\\n      org.opencontainers.image.url=\"https://nats.io\" \\\n      org.opencontainers.image.documentation=\"https://docs.nats.io\" \\\n      org.opencontainers.image.source=\"https://github.com/nats-io/nats-docker\" \\\n      org.opencontainers.image.vendor=\"NATS.io\" \\\n      org.opencontainers.image.licenses=\"Apache-2.0\" \\\n      org.opencontainers.image.version=\"${NATS_SERVER}\"\n\nRUN set -eux; \\\n    apkArch=\"$(apk --print-arch)\"; \\\n    case \"$apkArch\" in \\\n    aarch64) natsArch='arm64'; sha256='1172615d086fc0b2ebb599fe9ef6211aaffaa77cd8c0c7c3fd644dc5df9d4a77' ;; \\\n    armhf) natsArch='arm6'; sha256='64b1b6db4ad8ee7070bd6cc7e445c1b020aee8430ce5330363ecbda44e280425' ;; \\\n    armv7) natsArch='arm7'; sha256='ef1de4e9e1953718cead68f27ed2d79c118578753c8d47a6cd2c8c81aa2b098b' ;; \\\n    x86_64) natsArch='amd64'; sha256='8ab4859b8207c39cc74563b53290ab308550e427fd613845c6d581145499123e' ;; \\\n    x86) natsArch='386'; sha256='538931564839a839498f952ed9e8729fcc95591dc23509348418dd4ea4b65491' ;; \\\n    s390x) natsArch='s390x'; sha256='f49f9cb403e9c47cc084878d10b6bacedf4f5ce671642d44c44886a14fd364fe' ;; \\\n    ppc64le) natsArch='ppc64le'; sha256='404a60be0a538cebc055bad6b092f2690cecdca5eb7369a67bc9eba31663787e' ;; \\\n    loong64) natsArch='loong64'; sha256='7dcfee3f32ab812afa82fc87cb24471a737e9e13939b1040162eff111ac289b7' ;; \\\n    *) echo >&2 \"error: $apkArch is not supported!\"; exit 1 ;; \\\n    esac; \\\n    \\\n    wget -O nats-server.tar.gz \"https://github.com/nats-io/nats-server/releases/download/v${NATS_SERVER}/nats-server-v${NATS_SERVER}-linux-${natsArch}.tar.gz\"; \\\n    echo \"${sha256} *nats-server.tar.gz\" | sha256sum -c -; \\\n    \\\n    apk add --no-cache ca-certificates tzdata; \\\n    \\\n    tar -xf nats-server.tar.gz; \\\n    rm nats-server.tar.gz; \\\n    mv \"nats-server-v${NATS_SERVER}-linux-${natsArch}/nats-server\" /usr/local/bin; \\\n    rm -rf \"nats-server-v${NATS_SERVER}-linux-${natsArch}\";\n\nCOPY nats-server.conf /etc/nats/nats-server.conf\nCOPY docker-entrypoint.sh /usr/local/bin\n\nEXPOSE 4222 8222 6222\nENTRYPOINT [\"docker-entrypoint.sh\"]\nCMD [\"nats-server\", \"--config\", \"/etc/nats/nats-server.conf\"]\n"
  },
  {
    "path": "2.12.x/alpine3.22/docker-entrypoint.sh",
    "content": "#!/bin/sh\nset -e\n\n# this if will check if the first argument is a flag\n# but only works if all arguments require a hyphenated flag\n# -v; -SL; -f arg; etc will work, but not arg1 arg2\nif [ \"$#\" -eq 0 ] || [ \"${1#-}\" != \"$1\" ]; then\n    set -- nats-server \"$@\"\nfi\n\n# else default to run whatever the user wanted like \"bash\" or \"sh\"\nexec \"$@\"\n\n"
  },
  {
    "path": "2.12.x/alpine3.22/nats-server.conf",
    "content": "# Client port of 4222 on all interfaces\nport: 4222\n\n# HTTP monitoring port\nmonitor_port: 8222\n\n# This is for clustering multiple servers together.\ncluster {\n  # It is recommended to set a cluster name\n  name: \"my_cluster\"\n\n  # Route connections to be received on any interface on port 6222\n  port: 6222\n\n  # Routes are protected, so need to use them with --routes flag\n  # e.g. --routes=nats-route://ruser:T0pS3cr3t@otherdockerhost:6222\n  authorization {\n    user: ruser\n    password: T0pS3cr3t\n    timeout: 2\n  }\n\n  # Routes are actively solicited and connected to from this server.\n  # This Docker image has none by default, but you can pass a\n  # flag to the nats-server docker image to create one to an existing server.\n  routes = []\n}\n"
  },
  {
    "path": "2.12.x/nanoserver-ltsc2022/Dockerfile",
    "content": "FROM mcr.microsoft.com/windows/nanoserver:ltsc2022\nENV NATS_DOCKERIZED 1\n\nCOPY --from=nats:2.12.9-RC.1-windowsservercore-ltsc2022 C:\\\\nats-server.exe C:\\\\nats-server.exe\nCOPY nats-server.conf C:\\\\nats-server.conf\n\nEXPOSE 4222 8222 6222\nENTRYPOINT [\"C:\\\\nats-server.exe\"]\nCMD [\"--config\", \"nats-server.conf\"]\n"
  },
  {
    "path": "2.12.x/nanoserver-ltsc2022/Dockerfile.preview",
    "content": "ARG BASE_IMAGE=nats:2.12.9-RC.1-windowsservercore-ltsc2022\nFROM $BASE_IMAGE AS base\n\nFROM mcr.microsoft.com/windows/nanoserver:ltsc2022\nENV NATS_DOCKERIZED 1\n\nCOPY --from=base C:\\\\nats-server.exe C:\\\\nats-server.exe\nCOPY nats-server.conf C:\\\\nats-server.conf\n\nEXPOSE 4222 8222 6222\nENTRYPOINT [\"C:\\\\nats-server.exe\"]\nCMD [\"--config\", \"nats-server.conf\"]\n"
  },
  {
    "path": "2.12.x/nanoserver-ltsc2022/nats-server.conf",
    "content": "# Client port of 4222 on all interfaces\nport: 4222\n\n# HTTP monitoring port\nmonitor_port: 8222\n\n# This is for clustering multiple servers together.\ncluster {\n  # It is recommended to set a cluster name\n  name: \"my_cluster\"\n\n  # Route connections to be received on any interface on port 6222\n  port: 6222\n\n  # Routes are protected, so need to use them with --routes flag\n  # e.g. --routes=nats-route://ruser:T0pS3cr3t@otherdockerhost:6222\n  authorization {\n    user: ruser\n    password: T0pS3cr3t\n    timeout: 2\n  }\n\n  # Routes are actively solicited and connected to from this server.\n  # This Docker image has none by default, but you can pass a\n  # flag to the nats-server docker image to create one to an existing server.\n  routes = []\n}\n"
  },
  {
    "path": "2.12.x/nanoserver-ltsc2025/Dockerfile",
    "content": "FROM mcr.microsoft.com/windows/nanoserver:ltsc2025\nENV NATS_DOCKERIZED 1\n\nCOPY --from=nats:2.12.9-RC.1-windowsservercore-ltsc2025 C:\\\\nats-server.exe C:\\\\nats-server.exe\nCOPY nats-server.conf C:\\\\nats-server.conf\n\nEXPOSE 4222 8222 6222\nENTRYPOINT [\"C:\\\\nats-server.exe\"]\nCMD [\"--config\", \"nats-server.conf\"]\n"
  },
  {
    "path": "2.12.x/nanoserver-ltsc2025/Dockerfile.preview",
    "content": "ARG BASE_IMAGE=nats:2.12.9-RC.1-windowsservercore-ltsc2025\nFROM $BASE_IMAGE AS base\n\nFROM mcr.microsoft.com/windows/nanoserver:ltsc2025\nENV NATS_DOCKERIZED 1\n\nCOPY --from=base C:\\\\nats-server.exe C:\\\\nats-server.exe\nCOPY nats-server.conf C:\\\\nats-server.conf\n\nEXPOSE 4222 8222 6222\nENTRYPOINT [\"C:\\\\nats-server.exe\"]\nCMD [\"--config\", \"nats-server.conf\"]\n"
  },
  {
    "path": "2.12.x/nanoserver-ltsc2025/nats-server.conf",
    "content": "# Client port of 4222 on all interfaces\nport: 4222\n\n# HTTP monitoring port\nmonitor_port: 8222\n\n# This is for clustering multiple servers together.\ncluster {\n  # It is recommended to set a cluster name\n  name: \"my_cluster\"\n\n  # Route connections to be received on any interface on port 6222\n  port: 6222\n\n  # Routes are protected, so need to use them with --routes flag\n  # e.g. --routes=nats-route://ruser:T0pS3cr3t@otherdockerhost:6222\n  authorization {\n    user: ruser\n    password: T0pS3cr3t\n    timeout: 2\n  }\n\n  # Routes are actively solicited and connected to from this server.\n  # This Docker image has none by default, but you can pass a\n  # flag to the nats-server docker image to create one to an existing server.\n  routes = []\n}\n"
  },
  {
    "path": "2.12.x/scratch/Dockerfile",
    "content": "FROM scratch\nENV PATH=\"$PATH:/\"\n\nCOPY --from=nats:2.12.9-RC.1-alpine3.22 /usr/local/bin/nats-server /nats-server\nCOPY nats-server.conf /nats-server.conf\n\nEXPOSE 4222 8222 6222\nENTRYPOINT [\"/nats-server\"]\nCMD [\"--config\", \"nats-server.conf\"]\n"
  },
  {
    "path": "2.12.x/scratch/Dockerfile.preview",
    "content": "ARG BASE_IMAGE=nats:2.12.9-RC.1-alpine3.22\nFROM $BASE_IMAGE AS base\n\nFROM scratch\nENV PATH=\"$PATH:/\"\n\nCOPY --from=base /usr/local/bin/nats-server /nats-server\nCOPY nats-server.conf /nats-server.conf\n\nEXPOSE 4222 8222 6222\nENTRYPOINT [\"/nats-server\"]\nCMD [\"--config\", \"nats-server.conf\"]\n"
  },
  {
    "path": "2.12.x/scratch/nats-server.conf",
    "content": "# Client port of 4222 on all interfaces\nport: 4222\n\n# HTTP monitoring port\nmonitor_port: 8222\n\n# This is for clustering multiple servers together.\ncluster {\n  # It is recommended to set a cluster name\n  name: \"my_cluster\"\n\n  # Route connections to be received on any interface on port 6222\n  port: 6222\n\n  # Routes are protected, so need to use them with --routes flag\n  # e.g. --routes=nats-route://ruser:T0pS3cr3t@otherdockerhost:6222\n  authorization {\n    user: ruser\n    password: T0pS3cr3t\n    timeout: 2\n  }\n\n  # Routes are actively solicited and connected to from this server.\n  # This Docker image has none by default, but you can pass a\n  # flag to the nats-server docker image to create one to an existing server.\n  routes = []\n}\n"
  },
  {
    "path": "2.12.x/tests/build-images-ltsc2022.ps1",
    "content": "# Show statements as they run.\nSet-PSDebug -Trace 2\n# Exit on error.\n$ErrorActionPreference = \"Stop\"\n\n$ver = 'NATS_SERVER 2.12.9-RC.1'.Split(' ')[1]\n\nWrite-Output '-- host info ---'\nWrite-Output $PSVersionTable\nWrite-Output (Get-WMIObject win32_operatingsystem).name\nWrite-Output (Get-WMIObject win32_operatingsystem).OSArchitecture\n\n# The windowsservercore images must be built before the nanoserver images.\ncd \"../windowsservercore-ltsc2022\"\nWrite-Host \"building windowsservercore-ltsc2022\"\ndocker build --tag \"nats:${ver}-windowsservercore-ltsc2022\" .\nif ($LASTEXITCODE -ne 0) {\n    exit 1\n}\n\ncd \"../nanoserver-ltsc2022\"\nWrite-Host \"building nanoserver-ltsc2022\"\ndocker build --tag \"nats:${ver}-nanoserver-ltsc2022\" .\nif ($LASTEXITCODE -ne 0) {\n    exit 1\n}\n\ndocker images\n"
  },
  {
    "path": "2.12.x/tests/build-images-ltsc2025.ps1",
    "content": "# Show statements as they run.\nSet-PSDebug -Trace 2\n# Exit on error.\n$ErrorActionPreference = \"Stop\"\n\n$ver = 'NATS_SERVER 2.12.9-RC.1'.Split(' ')[1]\n\nWrite-Output '-- host info ---'\nWrite-Output $PSVersionTable\nWrite-Output (Get-WMIObject win32_operatingsystem).name\nWrite-Output (Get-WMIObject win32_operatingsystem).OSArchitecture\n\n# The windowsservercore images must be built before the nanoserver images.\ncd \"../windowsservercore-ltsc2025\"\nWrite-Host \"building windowsservercore-ltsc2025\"\ndocker build --tag \"nats:${ver}-windowsservercore-ltsc2025\" .\nif ($LASTEXITCODE -ne 0) {\n    exit 1\n}\n\ncd \"../nanoserver-ltsc2025\"\nWrite-Host \"building nanoserver-ltsc2025\"\ndocker build --tag \"nats:${ver}-nanoserver-ltsc2025\" .\nif ($LASTEXITCODE -ne 0) {\n    exit 1\n}\n\ndocker images\n"
  },
  {
    "path": "2.12.x/tests/build-images.sh",
    "content": "#!/usr/bin/env bash\nset -ex\n\nver=(NATS_SERVER 2.12.9-RC.1)\n\n(\n\tcd \"../alpine3.22\"\n\tdocker build --tag nats:${ver[1]}-alpine3.22 .\n)\n\n(\n\tcd \"../scratch\"\n\tdocker build --tag nats:${ver[1]}-scratch .\n)\n"
  },
  {
    "path": "2.12.x/tests/run-images-ltsc2022.ps1",
    "content": "# Show statements as they run.\nSet-PSDebug -Trace 2\n# Exit on error.\n$ErrorActionPreference = \"Stop\"\n\n$ver = \"NATS_SERVER 2.12.9-RC.1\".Split(\" \")[1]\n\n$images = @(\n\t\"nats:${ver}-windowsservercore-ltsc2022\",\n\t\"nats:${ver}-nanoserver-ltsc2022\"\n)\n\nforeach ($img in $images) {\n\tWrite-Output \"running ${img}\"\n\t$runId = & docker run --detach \"${img}\"\n\tsleep 1\n\n\tWrite-Output \"checking ${img}\"\n\tdocker ps --filter \"id=${runId}\" --filter \"status=running\" --quiet\n\tif ($LASTEXITCODE -ne 0) {\n\t\texit 1\n\t}\n\tdocker kill $runId\n}\n"
  },
  {
    "path": "2.12.x/tests/run-images-ltsc2025.ps1",
    "content": "# Show statements as they run.\nSet-PSDebug -Trace 2\n# Exit on error.\n$ErrorActionPreference = \"Stop\"\n\n$ver = \"NATS_SERVER 2.12.9-RC.1\".Split(\" \")[1]\n\n$images = @(\n\t\"nats:${ver}-windowsservercore-ltsc2025\",\n\t\"nats:${ver}-nanoserver-ltsc2025\"\n)\n\nforeach ($img in $images) {\n\tWrite-Output \"running ${img}\"\n\t$runId = & docker run --detach \"${img}\"\n\tsleep 1\n\n\tWrite-Output \"checking ${img}\"\n\tdocker logs \"$runId\"\n\tdocker ps --filter \"id=${runId}\" --filter \"status=running\" --quiet\n\tif ($LASTEXITCODE -ne 0) {\n\t\texit 1\n\t}\n\tdocker kill $runId\n}\n"
  },
  {
    "path": "2.12.x/tests/run-images.sh",
    "content": "#!/usr/bin/env bash\nset -ex\n\nver=(NATS_SERVER 2.12.9-RC.1)\n\nimages=(\n\t\"nats:${ver[1]}-alpine3.22\"\n\t\"nats:${ver[1]}-scratch\"\n)\n\nfor img in \"${images[@]}\"; do\n\trun_id=$(docker run --detach \"${img}\")\n\tsleep 1\n\ttest -n \"$(docker ps --filter \"id=${run_id}\" --filter \"status=running\" --quiet)\"\n\tdocker kill \"$run_id\"\ndone\n"
  },
  {
    "path": "2.12.x/windowsservercore-ltsc2022/Dockerfile",
    "content": "FROM mcr.microsoft.com/windows/servercore:ltsc2022\n\n# Enable exit on error.\nSHELL [\"powershell\", \"-Command\", \"$ErrorActionPreference = 'Stop';\"]\n\nENV NATS_DOCKERIZED 1\nENV NATS_SERVER 2.12.9-RC.1\n\nLABEL org.opencontainers.image.title=\"NATS Server\" \\\n      org.opencontainers.image.description=\"NATS is an open-source, high-performance, cloud native messaging system.\" \\\n      org.opencontainers.image.url=\"https://nats.io\" \\\n      org.opencontainers.image.documentation=\"https://docs.nats.io\" \\\n      org.opencontainers.image.source=\"https://github.com/nats-io/nats-docker\" \\\n      org.opencontainers.image.vendor=\"NATS.io\" \\\n      org.opencontainers.image.licenses=\"Apache-2.0\" \\\n      org.opencontainers.image.version=\"${NATS_SERVER}\"\n\nENV NATS_SERVER_DOWNLOAD https://github.com/nats-io/nats-server/releases/download/v${NATS_SERVER}/nats-server-v${NATS_SERVER}-windows-amd64.zip\nENV NATS_SERVER_SHASUM f4119594bda99347006167fb1d6c07cab5ab9c734d87744996bcc5db609ffbec\n\nRUN Set-PSDebug -Trace 2\n\nRUN Write-Host ('downloading from {0} ...' -f $env:NATS_SERVER_DOWNLOAD); \\\n\t[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \\\n\tInvoke-WebRequest -Uri $env:NATS_SERVER_DOWNLOAD -OutFile nats.zip; \\\n\t\\\n\tWrite-Host ('verifying sha256 ({0}) ...' -f $env:NATS_SERVER_SHASUM); \\\n\tif ((Get-FileHash nats.zip -Algorithm sha256).Hash -ne $env:NATS_SERVER_SHASUM) { \\\n\t\tWrite-Host 'FAILED!'; \\\n\t\texit 1; \\\n\t}; \\\n\tWrite-Host 'extracting nats.zip'; \\\n\tExpand-Archive -Path 'nats.zip' -DestinationPath .; \\\n\t\\\n\tWrite-Host 'copying binary'; \\\n\tCopy-Item nats-server-v*/nats-server.exe -Destination C:\\\\nats-server.exe; \\\n\t\\\n\tWrite-Host 'cleaning up'; \\\n\tRemove-Item -Force nats.zip; \\\n\tRemove-Item -Recurse -Force nats-server-v*; \\\n\t\\\n\tWrite-Host 'complete.';\n\nCOPY nats-server.conf C:\\\\nats-server.conf\n\nEXPOSE 4222 8222 6222\nENTRYPOINT [\"C:\\\\nats-server.exe\"]\nCMD [\"--config\", \"nats-server.conf\"]\n"
  },
  {
    "path": "2.12.x/windowsservercore-ltsc2022/nats-server.conf",
    "content": "# Client port of 4222 on all interfaces\nport: 4222\n\n# HTTP monitoring port\nmonitor_port: 8222\n\n# This is for clustering multiple servers together.\ncluster {\n  # It is recommended to set a cluster name\n  name: \"my_cluster\"\n\n  # Route connections to be received on any interface on port 6222\n  port: 6222\n\n  # Routes are protected, so need to use them with --routes flag\n  # e.g. --routes=nats-route://ruser:T0pS3cr3t@otherdockerhost:6222\n  authorization {\n    user: ruser\n    password: T0pS3cr3t\n    timeout: 2\n  }\n\n  # Routes are actively solicited and connected to from this server.\n  # This Docker image has none by default, but you can pass a\n  # flag to the nats-server docker image to create one to an existing server.\n  routes = []\n}\n"
  },
  {
    "path": "2.12.x/windowsservercore-ltsc2025/Dockerfile",
    "content": "FROM mcr.microsoft.com/windows/servercore:ltsc2025\n\n# Enable exit on error.\nSHELL [\"powershell\", \"-Command\", \"$ErrorActionPreference = 'Stop';\"]\n\nENV NATS_DOCKERIZED 1\nENV NATS_SERVER 2.12.9-RC.1\n\nLABEL org.opencontainers.image.title=\"NATS Server\" \\\n      org.opencontainers.image.description=\"NATS is an open-source, high-performance, cloud native messaging system.\" \\\n      org.opencontainers.image.url=\"https://nats.io\" \\\n      org.opencontainers.image.documentation=\"https://docs.nats.io\" \\\n      org.opencontainers.image.source=\"https://github.com/nats-io/nats-docker\" \\\n      org.opencontainers.image.vendor=\"NATS.io\" \\\n      org.opencontainers.image.licenses=\"Apache-2.0\" \\\n      org.opencontainers.image.version=\"${NATS_SERVER}\"\n\nENV NATS_SERVER_DOWNLOAD https://github.com/nats-io/nats-server/releases/download/v${NATS_SERVER}/nats-server-v${NATS_SERVER}-windows-amd64.zip\nENV NATS_SERVER_SHASUM f4119594bda99347006167fb1d6c07cab5ab9c734d87744996bcc5db609ffbec\n\nRUN Set-PSDebug -Trace 2\n\nRUN Write-Host ('downloading from {0} ...' -f $env:NATS_SERVER_DOWNLOAD); \\\n    [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \\\n    Invoke-WebRequest -Uri $env:NATS_SERVER_DOWNLOAD -OutFile nats.zip; \\\n    \\\n    Write-Host ('verifying sha256 ({0}) ...' -f $env:NATS_SERVER_SHASUM); \\\n    if ((Get-FileHash nats.zip -Algorithm sha256).Hash -ne $env:NATS_SERVER_SHASUM) { \\\n    Write-Host 'FAILED!'; \\\n    exit 1; \\\n    }; \\\n    Write-Host 'extracting nats.zip'; \\\n    Expand-Archive -Path 'nats.zip' -DestinationPath .; \\\n    \\\n    Write-Host 'copying binary'; \\\n    Copy-Item nats-server-v*/nats-server.exe -Destination C:\\\\nats-server.exe; \\\n    \\\n    Write-Host 'cleaning up'; \\\n    Remove-Item -Force nats.zip; \\\n    Remove-Item -Recurse -Force nats-server-v*; \\\n    \\\n    Write-Host 'complete.';\n\nCOPY nats-server.conf C:\\\\nats-server.conf\n\nEXPOSE 4222 8222 6222\nENTRYPOINT [\"C:\\\\nats-server.exe\"]\nCMD [\"--config\", \"nats-server.conf\"]\n"
  },
  {
    "path": "2.12.x/windowsservercore-ltsc2025/nats-server.conf",
    "content": "# Client port of 4222 on all interfaces\nport: 4222\n\n# HTTP monitoring port\nmonitor_port: 8222\n\n# This is for clustering multiple servers together.\ncluster {\n  # It is recommended to set a cluster name\n  name: \"my_cluster\"\n\n  # Route connections to be received on any interface on port 6222\n  port: 6222\n\n  # Routes are protected, so need to use them with --routes flag\n  # e.g. --routes=nats-route://ruser:T0pS3cr3t@otherdockerhost:6222\n  authorization {\n    user: ruser\n    password: T0pS3cr3t\n    timeout: 2\n  }\n\n  # Routes are actively solicited and connected to from this server.\n  # This Docker image has none by default, but you can pass a\n  # flag to the nats-server docker image to create one to an existing server.\n  routes = []\n}\n"
  },
  {
    "path": "2.14.x/alpine3.22/Dockerfile",
    "content": "FROM alpine:3.22\n\nENV NATS_SERVER 2.14.1-RC.1\n\nLABEL org.opencontainers.image.title=\"NATS Server\" \\\n      org.opencontainers.image.description=\"NATS is an open-source, high-performance, cloud native messaging system.\" \\\n      org.opencontainers.image.url=\"https://nats.io\" \\\n      org.opencontainers.image.documentation=\"https://docs.nats.io\" \\\n      org.opencontainers.image.source=\"https://github.com/nats-io/nats-docker\" \\\n      org.opencontainers.image.vendor=\"NATS.io\" \\\n      org.opencontainers.image.licenses=\"Apache-2.0\" \\\n      org.opencontainers.image.version=\"${NATS_SERVER}\"\n\nRUN set -eux; \\\n    apkArch=\"$(apk --print-arch)\"; \\\n    case \"$apkArch\" in \\\n    aarch64) natsArch='arm64'; sha256='c48b0bbb46427075fa6d47f4b639f99f9f6b1b4adcf2ed28181379523b9b8f98' ;; \\\n    armhf) natsArch='arm6'; sha256='fa51ba7dc43fec0d5d24930d1f6b56c93ca88a26d1b9830424af934eef43d07e' ;; \\\n    armv7) natsArch='arm7'; sha256='c57b0099a6b0b89f8200e37e034756662179d08ff890f99f002e9674779c6e5f' ;; \\\n    x86_64) natsArch='amd64'; sha256='fdd800cf565dc5c32f122e1d1bbc34810be72675a27bbc7baf68b7067ce2a9e6' ;; \\\n    x86) natsArch='386'; sha256='9e66899796640f5fdea2f92e8a73c80527823b00375672dc172516a7a2662bea' ;; \\\n    s390x) natsArch='s390x'; sha256='7e7d734ff489950d5409250007fad504345ef57d5e765202decfb05f56433c73' ;; \\\n    ppc64le) natsArch='ppc64le'; sha256='9e9d77cbcdc9a1e8c43dc6839f68b898cdf5d3dc0f5d7e33a02c2373773653a4' ;; \\\n    loong64) natsArch='loong64'; sha256='eddf206b81ff78bd97f3e69e2eae9122b02ad864dee371f6f4db84da4a6f52b4' ;; \\\n    *) echo >&2 \"error: $apkArch is not supported!\"; exit 1 ;; \\\n    esac; \\\n    \\\n    wget -O nats-server.tar.gz \"https://github.com/nats-io/nats-server/releases/download/v${NATS_SERVER}/nats-server-v${NATS_SERVER}-linux-${natsArch}.tar.gz\"; \\\n    echo \"${sha256} *nats-server.tar.gz\" | sha256sum -c -; \\\n    \\\n    apk add --no-cache ca-certificates tzdata; \\\n    \\\n    tar -xf nats-server.tar.gz; \\\n    rm nats-server.tar.gz; \\\n    mv \"nats-server-v${NATS_SERVER}-linux-${natsArch}/nats-server\" /usr/local/bin; \\\n    rm -rf \"nats-server-v${NATS_SERVER}-linux-${natsArch}\";\n\nCOPY nats-server.conf /etc/nats/nats-server.conf\nCOPY docker-entrypoint.sh /usr/local/bin\n\nEXPOSE 4222 8222 6222\nENTRYPOINT [\"docker-entrypoint.sh\"]\nCMD [\"nats-server\", \"--config\", \"/etc/nats/nats-server.conf\"]\n"
  },
  {
    "path": "2.14.x/alpine3.22/docker-entrypoint.sh",
    "content": "#!/bin/sh\nset -e\n\n# this if will check if the first argument is a flag\n# but only works if all arguments require a hyphenated flag\n# -v; -SL; -f arg; etc will work, but not arg1 arg2\nif [ \"$#\" -eq 0 ] || [ \"${1#-}\" != \"$1\" ]; then\n    set -- nats-server \"$@\"\nfi\n\n# else default to run whatever the user wanted like \"bash\" or \"sh\"\nexec \"$@\"\n\n"
  },
  {
    "path": "2.14.x/alpine3.22/nats-server.conf",
    "content": "# Client port of 4222 on all interfaces\nport: 4222\n\n# HTTP monitoring port\nmonitor_port: 8222\n\n# This is for clustering multiple servers together.\ncluster {\n  # It is recommended to set a cluster name\n  name: \"my_cluster\"\n\n  # Route connections to be received on any interface on port 6222\n  port: 6222\n\n  # Routes are protected, so need to use them with --routes flag\n  # e.g. --routes=nats-route://ruser:T0pS3cr3t@otherdockerhost:6222\n  authorization {\n    user: ruser\n    password: T0pS3cr3t\n    timeout: 2\n  }\n\n  # Routes are actively solicited and connected to from this server.\n  # This Docker image has none by default, but you can pass a\n  # flag to the nats-server docker image to create one to an existing server.\n  routes = []\n}\n"
  },
  {
    "path": "2.14.x/nanoserver-ltsc2022/Dockerfile",
    "content": "FROM mcr.microsoft.com/windows/nanoserver:ltsc2022\nENV NATS_DOCKERIZED 1\n\nCOPY --from=nats:2.14.1-RC.1-windowsservercore-ltsc2022 C:\\\\nats-server.exe C:\\\\nats-server.exe\nCOPY nats-server.conf C:\\\\nats-server.conf\n\nEXPOSE 4222 8222 6222\nENTRYPOINT [\"C:\\\\nats-server.exe\"]\nCMD [\"--config\", \"nats-server.conf\"]\n"
  },
  {
    "path": "2.14.x/nanoserver-ltsc2022/Dockerfile.preview",
    "content": "ARG BASE_IMAGE=nats:2.14.1-RC.1-windowsservercore-ltsc2022\nFROM $BASE_IMAGE AS base\n\nFROM mcr.microsoft.com/windows/nanoserver:ltsc2022\nENV NATS_DOCKERIZED 1\n\nCOPY --from=base C:\\\\nats-server.exe C:\\\\nats-server.exe\nCOPY nats-server.conf C:\\\\nats-server.conf\n\nEXPOSE 4222 8222 6222\nENTRYPOINT [\"C:\\\\nats-server.exe\"]\nCMD [\"--config\", \"nats-server.conf\"]\n"
  },
  {
    "path": "2.14.x/nanoserver-ltsc2022/nats-server.conf",
    "content": "# Client port of 4222 on all interfaces\nport: 4222\n\n# HTTP monitoring port\nmonitor_port: 8222\n\n# This is for clustering multiple servers together.\ncluster {\n  # It is recommended to set a cluster name\n  name: \"my_cluster\"\n\n  # Route connections to be received on any interface on port 6222\n  port: 6222\n\n  # Routes are protected, so need to use them with --routes flag\n  # e.g. --routes=nats-route://ruser:T0pS3cr3t@otherdockerhost:6222\n  authorization {\n    user: ruser\n    password: T0pS3cr3t\n    timeout: 2\n  }\n\n  # Routes are actively solicited and connected to from this server.\n  # This Docker image has none by default, but you can pass a\n  # flag to the nats-server docker image to create one to an existing server.\n  routes = []\n}\n"
  },
  {
    "path": "2.14.x/nanoserver-ltsc2025/Dockerfile",
    "content": "FROM mcr.microsoft.com/windows/nanoserver:ltsc2025\nENV NATS_DOCKERIZED 1\n\nCOPY --from=nats:2.14.1-RC.1-windowsservercore-ltsc2025 C:\\\\nats-server.exe C:\\\\nats-server.exe\nCOPY nats-server.conf C:\\\\nats-server.conf\n\nEXPOSE 4222 8222 6222\nENTRYPOINT [\"C:\\\\nats-server.exe\"]\nCMD [\"--config\", \"nats-server.conf\"]\n"
  },
  {
    "path": "2.14.x/nanoserver-ltsc2025/Dockerfile.preview",
    "content": "ARG BASE_IMAGE=nats:2.14.1-RC.1-windowsservercore-ltsc2025\nFROM $BASE_IMAGE AS base\n\nFROM mcr.microsoft.com/windows/nanoserver:ltsc2025\nENV NATS_DOCKERIZED 1\n\nCOPY --from=base C:\\\\nats-server.exe C:\\\\nats-server.exe\nCOPY nats-server.conf C:\\\\nats-server.conf\n\nEXPOSE 4222 8222 6222\nENTRYPOINT [\"C:\\\\nats-server.exe\"]\nCMD [\"--config\", \"nats-server.conf\"]\n"
  },
  {
    "path": "2.14.x/nanoserver-ltsc2025/nats-server.conf",
    "content": "# Client port of 4222 on all interfaces\nport: 4222\n\n# HTTP monitoring port\nmonitor_port: 8222\n\n# This is for clustering multiple servers together.\ncluster {\n  # It is recommended to set a cluster name\n  name: \"my_cluster\"\n\n  # Route connections to be received on any interface on port 6222\n  port: 6222\n\n  # Routes are protected, so need to use them with --routes flag\n  # e.g. --routes=nats-route://ruser:T0pS3cr3t@otherdockerhost:6222\n  authorization {\n    user: ruser\n    password: T0pS3cr3t\n    timeout: 2\n  }\n\n  # Routes are actively solicited and connected to from this server.\n  # This Docker image has none by default, but you can pass a\n  # flag to the nats-server docker image to create one to an existing server.\n  routes = []\n}\n"
  },
  {
    "path": "2.14.x/scratch/Dockerfile",
    "content": "FROM scratch\nENV PATH=\"$PATH:/\"\n\nCOPY --from=nats:2.14.1-RC.1-alpine3.22 /usr/local/bin/nats-server /nats-server\nCOPY nats-server.conf /nats-server.conf\n\nEXPOSE 4222 8222 6222\nENTRYPOINT [\"/nats-server\"]\nCMD [\"--config\", \"nats-server.conf\"]\n"
  },
  {
    "path": "2.14.x/scratch/Dockerfile.preview",
    "content": "ARG BASE_IMAGE=nats:2.14.1-RC.1-alpine3.22\nFROM $BASE_IMAGE AS base\n\nFROM scratch\nENV PATH=\"$PATH:/\"\n\nCOPY --from=base /usr/local/bin/nats-server /nats-server\nCOPY nats-server.conf /nats-server.conf\n\nEXPOSE 4222 8222 6222\nENTRYPOINT [\"/nats-server\"]\nCMD [\"--config\", \"nats-server.conf\"]\n"
  },
  {
    "path": "2.14.x/scratch/nats-server.conf",
    "content": "# Client port of 4222 on all interfaces\nport: 4222\n\n# HTTP monitoring port\nmonitor_port: 8222\n\n# This is for clustering multiple servers together.\ncluster {\n  # It is recommended to set a cluster name\n  name: \"my_cluster\"\n\n  # Route connections to be received on any interface on port 6222\n  port: 6222\n\n  # Routes are protected, so need to use them with --routes flag\n  # e.g. --routes=nats-route://ruser:T0pS3cr3t@otherdockerhost:6222\n  authorization {\n    user: ruser\n    password: T0pS3cr3t\n    timeout: 2\n  }\n\n  # Routes are actively solicited and connected to from this server.\n  # This Docker image has none by default, but you can pass a\n  # flag to the nats-server docker image to create one to an existing server.\n  routes = []\n}\n"
  },
  {
    "path": "2.14.x/tests/build-images-ltsc2022.ps1",
    "content": "# Show statements as they run.\nSet-PSDebug -Trace 2\n# Exit on error.\n$ErrorActionPreference = \"Stop\"\n\n$ver = 'NATS_SERVER 2.14.1-RC.1'.Split(' ')[1]\n\nWrite-Output '-- host info ---'\nWrite-Output $PSVersionTable\nWrite-Output (Get-WMIObject win32_operatingsystem).name\nWrite-Output (Get-WMIObject win32_operatingsystem).OSArchitecture\n\n# The windowsservercore images must be built before the nanoserver images.\ncd \"../windowsservercore-ltsc2022\"\nWrite-Host \"building windowsservercore-ltsc2022\"\ndocker build --tag \"nats:${ver}-windowsservercore-ltsc2022\" .\nif ($LASTEXITCODE -ne 0) {\n    exit 1\n}\n\ncd \"../nanoserver-ltsc2022\"\nWrite-Host \"building nanoserver-ltsc2022\"\ndocker build --tag \"nats:${ver}-nanoserver-ltsc2022\" .\nif ($LASTEXITCODE -ne 0) {\n    exit 1\n}\n\ndocker images\n"
  },
  {
    "path": "2.14.x/tests/build-images-ltsc2025.ps1",
    "content": "# Show statements as they run.\nSet-PSDebug -Trace 2\n# Exit on error.\n$ErrorActionPreference = \"Stop\"\n\n$ver = 'NATS_SERVER 2.14.1-RC.1'.Split(' ')[1]\n\nWrite-Output '-- host info ---'\nWrite-Output $PSVersionTable\nWrite-Output (Get-WMIObject win32_operatingsystem).name\nWrite-Output (Get-WMIObject win32_operatingsystem).OSArchitecture\n\n# The windowsservercore images must be built before the nanoserver images.\ncd \"../windowsservercore-ltsc2025\"\nWrite-Host \"building windowsservercore-ltsc2025\"\ndocker build --tag \"nats:${ver}-windowsservercore-ltsc2025\" .\nif ($LASTEXITCODE -ne 0) {\n    exit 1\n}\n\ncd \"../nanoserver-ltsc2025\"\nWrite-Host \"building nanoserver-ltsc2025\"\ndocker build --tag \"nats:${ver}-nanoserver-ltsc2025\" .\nif ($LASTEXITCODE -ne 0) {\n    exit 1\n}\n\ndocker images\n"
  },
  {
    "path": "2.14.x/tests/build-images.sh",
    "content": "#!/usr/bin/env bash\nset -ex\n\nver=(NATS_SERVER 2.14.1-RC.1)\n\n(\n\tcd \"../alpine3.22\"\n\tdocker build --tag nats:${ver[1]}-alpine3.22 .\n)\n\n(\n\tcd \"../scratch\"\n\tdocker build --tag nats:${ver[1]}-scratch .\n)\n"
  },
  {
    "path": "2.14.x/tests/run-images-ltsc2022.ps1",
    "content": "# Show statements as they run.\nSet-PSDebug -Trace 2\n# Exit on error.\n$ErrorActionPreference = \"Stop\"\n\n$ver = \"NATS_SERVER 2.14.1-RC.1\".Split(\" \")[1]\n\n$images = @(\n\t\"nats:${ver}-windowsservercore-ltsc2022\",\n\t\"nats:${ver}-nanoserver-ltsc2022\"\n)\n\nforeach ($img in $images) {\n\tWrite-Output \"running ${img}\"\n\t$runId = & docker run --detach \"${img}\"\n\tsleep 1\n\n\tWrite-Output \"checking ${img}\"\n\tdocker ps --filter \"id=${runId}\" --filter \"status=running\" --quiet\n\tif ($LASTEXITCODE -ne 0) {\n\t\texit 1\n\t}\n\tdocker kill $runId\n}\n"
  },
  {
    "path": "2.14.x/tests/run-images-ltsc2025.ps1",
    "content": "# Show statements as they run.\nSet-PSDebug -Trace 2\n# Exit on error.\n$ErrorActionPreference = \"Stop\"\n\n$ver = \"NATS_SERVER 2.14.1-RC.1\".Split(\" \")[1]\n\n$images = @(\n\t\"nats:${ver}-windowsservercore-ltsc2025\",\n\t\"nats:${ver}-nanoserver-ltsc2025\"\n)\n\nforeach ($img in $images) {\n\tWrite-Output \"running ${img}\"\n\t$runId = & docker run --detach \"${img}\"\n\tsleep 1\n\n\tWrite-Output \"checking ${img}\"\n\tdocker logs \"$runId\"\n\tdocker ps --filter \"id=${runId}\" --filter \"status=running\" --quiet\n\tif ($LASTEXITCODE -ne 0) {\n\t\texit 1\n\t}\n\tdocker kill $runId\n}\n"
  },
  {
    "path": "2.14.x/tests/run-images.sh",
    "content": "#!/usr/bin/env bash\nset -ex\n\nver=(NATS_SERVER 2.14.1-RC.1)\n\nimages=(\n\t\"nats:${ver[1]}-alpine3.22\"\n\t\"nats:${ver[1]}-scratch\"\n)\n\nfor img in \"${images[@]}\"; do\n\trun_id=$(docker run --detach \"${img}\")\n\tsleep 1\n\ttest -n \"$(docker ps --filter \"id=${run_id}\" --filter \"status=running\" --quiet)\"\n\tdocker kill \"$run_id\"\ndone\n"
  },
  {
    "path": "2.14.x/windowsservercore-ltsc2022/Dockerfile",
    "content": "FROM mcr.microsoft.com/windows/servercore:ltsc2022\n\n# Enable exit on error.\nSHELL [\"powershell\", \"-Command\", \"$ErrorActionPreference = 'Stop';\"]\n\nENV NATS_DOCKERIZED 1\nENV NATS_SERVER 2.14.1-RC.1\n\nLABEL org.opencontainers.image.title=\"NATS Server\" \\\n      org.opencontainers.image.description=\"NATS is an open-source, high-performance, cloud native messaging system.\" \\\n      org.opencontainers.image.url=\"https://nats.io\" \\\n      org.opencontainers.image.documentation=\"https://docs.nats.io\" \\\n      org.opencontainers.image.source=\"https://github.com/nats-io/nats-docker\" \\\n      org.opencontainers.image.vendor=\"NATS.io\" \\\n      org.opencontainers.image.licenses=\"Apache-2.0\" \\\n      org.opencontainers.image.version=\"${NATS_SERVER}\"\n\nENV NATS_SERVER_DOWNLOAD https://github.com/nats-io/nats-server/releases/download/v${NATS_SERVER}/nats-server-v${NATS_SERVER}-windows-amd64.zip\nENV NATS_SERVER_SHASUM 3d229792d7ef436497bca067d6961a893e7c2b5d1df8da0b020220a729d12cc3\n\nRUN Set-PSDebug -Trace 2\n\nRUN Write-Host ('downloading from {0} ...' -f $env:NATS_SERVER_DOWNLOAD); \\\n\t[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \\\n\tInvoke-WebRequest -Uri $env:NATS_SERVER_DOWNLOAD -OutFile nats.zip; \\\n\t\\\n\tWrite-Host ('verifying sha256 ({0}) ...' -f $env:NATS_SERVER_SHASUM); \\\n\tif ((Get-FileHash nats.zip -Algorithm sha256).Hash -ne $env:NATS_SERVER_SHASUM) { \\\n\t\tWrite-Host 'FAILED!'; \\\n\t\texit 1; \\\n\t}; \\\n\tWrite-Host 'extracting nats.zip'; \\\n\tExpand-Archive -Path 'nats.zip' -DestinationPath .; \\\n\t\\\n\tWrite-Host 'copying binary'; \\\n\tCopy-Item nats-server-v*/nats-server.exe -Destination C:\\\\nats-server.exe; \\\n\t\\\n\tWrite-Host 'cleaning up'; \\\n\tRemove-Item -Force nats.zip; \\\n\tRemove-Item -Recurse -Force nats-server-v*; \\\n\t\\\n\tWrite-Host 'complete.';\n\nCOPY nats-server.conf C:\\\\nats-server.conf\n\nEXPOSE 4222 8222 6222\nENTRYPOINT [\"C:\\\\nats-server.exe\"]\nCMD [\"--config\", \"nats-server.conf\"]\n"
  },
  {
    "path": "2.14.x/windowsservercore-ltsc2022/nats-server.conf",
    "content": "# Client port of 4222 on all interfaces\nport: 4222\n\n# HTTP monitoring port\nmonitor_port: 8222\n\n# This is for clustering multiple servers together.\ncluster {\n  # It is recommended to set a cluster name\n  name: \"my_cluster\"\n\n  # Route connections to be received on any interface on port 6222\n  port: 6222\n\n  # Routes are protected, so need to use them with --routes flag\n  # e.g. --routes=nats-route://ruser:T0pS3cr3t@otherdockerhost:6222\n  authorization {\n    user: ruser\n    password: T0pS3cr3t\n    timeout: 2\n  }\n\n  # Routes are actively solicited and connected to from this server.\n  # This Docker image has none by default, but you can pass a\n  # flag to the nats-server docker image to create one to an existing server.\n  routes = []\n}\n"
  },
  {
    "path": "2.14.x/windowsservercore-ltsc2025/Dockerfile",
    "content": "FROM mcr.microsoft.com/windows/servercore:ltsc2025\n\n# Enable exit on error.\nSHELL [\"powershell\", \"-Command\", \"$ErrorActionPreference = 'Stop';\"]\n\nENV NATS_DOCKERIZED 1\nENV NATS_SERVER 2.14.1-RC.1\n\nLABEL org.opencontainers.image.title=\"NATS Server\" \\\n      org.opencontainers.image.description=\"NATS is an open-source, high-performance, cloud native messaging system.\" \\\n      org.opencontainers.image.url=\"https://nats.io\" \\\n      org.opencontainers.image.documentation=\"https://docs.nats.io\" \\\n      org.opencontainers.image.source=\"https://github.com/nats-io/nats-docker\" \\\n      org.opencontainers.image.vendor=\"NATS.io\" \\\n      org.opencontainers.image.licenses=\"Apache-2.0\" \\\n      org.opencontainers.image.version=\"${NATS_SERVER}\"\n\nENV NATS_SERVER_DOWNLOAD https://github.com/nats-io/nats-server/releases/download/v${NATS_SERVER}/nats-server-v${NATS_SERVER}-windows-amd64.zip\nENV NATS_SERVER_SHASUM 3d229792d7ef436497bca067d6961a893e7c2b5d1df8da0b020220a729d12cc3\n\nRUN Set-PSDebug -Trace 2\n\nRUN Write-Host ('downloading from {0} ...' -f $env:NATS_SERVER_DOWNLOAD); \\\n    [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \\\n    Invoke-WebRequest -Uri $env:NATS_SERVER_DOWNLOAD -OutFile nats.zip; \\\n    \\\n    Write-Host ('verifying sha256 ({0}) ...' -f $env:NATS_SERVER_SHASUM); \\\n    if ((Get-FileHash nats.zip -Algorithm sha256).Hash -ne $env:NATS_SERVER_SHASUM) { \\\n    Write-Host 'FAILED!'; \\\n    exit 1; \\\n    }; \\\n    Write-Host 'extracting nats.zip'; \\\n    Expand-Archive -Path 'nats.zip' -DestinationPath .; \\\n    \\\n    Write-Host 'copying binary'; \\\n    Copy-Item nats-server-v*/nats-server.exe -Destination C:\\\\nats-server.exe; \\\n    \\\n    Write-Host 'cleaning up'; \\\n    Remove-Item -Force nats.zip; \\\n    Remove-Item -Recurse -Force nats-server-v*; \\\n    \\\n    Write-Host 'complete.';\n\nCOPY nats-server.conf C:\\\\nats-server.conf\n\nEXPOSE 4222 8222 6222\nENTRYPOINT [\"C:\\\\nats-server.exe\"]\nCMD [\"--config\", \"nats-server.conf\"]\n"
  },
  {
    "path": "2.14.x/windowsservercore-ltsc2025/nats-server.conf",
    "content": "# Client port of 4222 on all interfaces\nport: 4222\n\n# HTTP monitoring port\nmonitor_port: 8222\n\n# This is for clustering multiple servers together.\ncluster {\n  # It is recommended to set a cluster name\n  name: \"my_cluster\"\n\n  # Route connections to be received on any interface on port 6222\n  port: 6222\n\n  # Routes are protected, so need to use them with --routes flag\n  # e.g. --routes=nats-route://ruser:T0pS3cr3t@otherdockerhost:6222\n  authorization {\n    user: ruser\n    password: T0pS3cr3t\n    timeout: 2\n  }\n\n  # Routes are actively solicited and connected to from this server.\n  # This Docker image has none by default, but you can pass a\n  # flag to the nats-server docker image to create one to an existing server.\n  routes = []\n}\n"
  },
  {
    "path": "LICENSE",
    "content": "                                 Apache License\n                           Version 2.0, January 2004\n                        http://www.apache.org/licenses/\n\n   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n   1. Definitions.\n\n      \"License\" shall mean the terms and conditions for use, reproduction,\n      and distribution as defined by Sections 1 through 9 of this document.\n\n      \"Licensor\" shall mean the copyright owner or entity authorized by\n      the copyright owner that is granting the License.\n\n      \"Legal Entity\" shall mean the union of the acting entity and all\n      other entities that control, are controlled by, or are under common\n      control with that entity. For the purposes of this definition,\n      \"control\" means (i) the power, direct or indirect, to cause the\n      direction or management of such entity, whether by contract or\n      otherwise, or (ii) ownership of fifty percent (50%) or more of the\n      outstanding shares, or (iii) beneficial ownership of such entity.\n\n      \"You\" (or \"Your\") shall mean an individual or Legal Entity\n      exercising permissions granted by this License.\n\n      \"Source\" form shall mean the preferred form for making modifications,\n      including but not limited to software source code, documentation\n      source, and configuration files.\n\n      \"Object\" form shall mean any form resulting from mechanical\n      transformation or translation of a Source form, including but\n      not limited to compiled object code, generated documentation,\n      and conversions to other media types.\n\n      \"Work\" shall mean the work of authorship, whether in Source or\n      Object form, made available under the License, as indicated by a\n      copyright notice that is included in or attached to the work\n      (an example is provided in the Appendix below).\n\n      \"Derivative Works\" shall mean any work, whether in Source or Object\n      form, that is based on (or derived from) the Work and for which the\n      editorial revisions, annotations, elaborations, or other modifications\n      represent, as a whole, an original work of authorship. For the purposes\n      of this License, Derivative Works shall not include works that remain\n      separable from, or merely link (or bind by name) to the interfaces of,\n      the Work and Derivative Works thereof.\n\n      \"Contribution\" shall mean any work of authorship, including\n      the original version of the Work and any modifications or additions\n      to that Work or Derivative Works thereof, that is intentionally\n      submitted to Licensor for inclusion in the Work by the copyright owner\n      or by an individual or Legal Entity authorized to submit on behalf of\n      the copyright owner. For the purposes of this definition, \"submitted\"\n      means any form of electronic, verbal, or written communication sent\n      to the Licensor or its representatives, including but not limited to\n      communication on electronic mailing lists, source code control systems,\n      and issue tracking systems that are managed by, or on behalf of, the\n      Licensor for the purpose of discussing and improving the Work, but\n      excluding communication that is conspicuously marked or otherwise\n      designated in writing by the copyright owner as \"Not a Contribution.\"\n\n      \"Contributor\" shall mean Licensor and any individual or Legal Entity\n      on behalf of whom a Contribution has been received by Licensor and\n      subsequently incorporated within the Work.\n\n   2. Grant of Copyright License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      copyright license to reproduce, prepare Derivative Works of,\n      publicly display, publicly perform, sublicense, and distribute the\n      Work and such Derivative Works in Source or Object form.\n\n   3. Grant of Patent License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      (except as stated in this section) patent license to make, have made,\n      use, offer to sell, sell, import, and otherwise transfer the Work,\n      where such license applies only to those patent claims licensable\n      by such Contributor that are necessarily infringed by their\n      Contribution(s) alone or by combination of their Contribution(s)\n      with the Work to which such Contribution(s) was submitted. If You\n      institute patent litigation against any entity (including a\n      cross-claim or counterclaim in a lawsuit) alleging that the Work\n      or a Contribution incorporated within the Work constitutes direct\n      or contributory patent infringement, then any patent licenses\n      granted to You under this License for that Work shall terminate\n      as of the date such litigation is filed.\n\n   4. Redistribution. You may reproduce and distribute copies of the\n      Work or Derivative Works thereof in any medium, with or without\n      modifications, and in Source or Object form, provided that You\n      meet the following conditions:\n\n      (a) You must give any other recipients of the Work or\n          Derivative Works a copy of this License; and\n\n      (b) You must cause any modified files to carry prominent notices\n          stating that You changed the files; and\n\n      (c) You must retain, in the Source form of any Derivative Works\n          that You distribute, all copyright, patent, trademark, and\n          attribution notices from the Source form of the Work,\n          excluding those notices that do not pertain to any part of\n          the Derivative Works; and\n\n      (d) If the Work includes a \"NOTICE\" text file as part of its\n          distribution, then any Derivative Works that You distribute must\n          include a readable copy of the attribution notices contained\n          within such NOTICE file, excluding those notices that do not\n          pertain to any part of the Derivative Works, in at least one\n          of the following places: within a NOTICE text file distributed\n          as part of the Derivative Works; within the Source form or\n          documentation, if provided along with the Derivative Works; or,\n          within a display generated by the Derivative Works, if and\n          wherever such third-party notices normally appear. The contents\n          of the NOTICE file are for informational purposes only and\n          do not modify the License. You may add Your own attribution\n          notices within Derivative Works that You distribute, alongside\n          or as an addendum to the NOTICE text from the Work, provided\n          that such additional attribution notices cannot be construed\n          as modifying the License.\n\n      You may add Your own copyright statement to Your modifications and\n      may provide additional or different license terms and conditions\n      for use, reproduction, or distribution of Your modifications, or\n      for any such Derivative Works as a whole, provided Your use,\n      reproduction, and distribution of the Work otherwise complies with\n      the conditions stated in this License.\n\n   5. Submission of Contributions. Unless You explicitly state otherwise,\n      any Contribution intentionally submitted for inclusion in the Work\n      by You to the Licensor shall be under the terms and conditions of\n      this License, without any additional terms or conditions.\n      Notwithstanding the above, nothing herein shall supersede or modify\n      the terms of any separate license agreement you may have executed\n      with Licensor regarding such Contributions.\n\n   6. Trademarks. This License does not grant permission to use the trade\n      names, trademarks, service marks, or product names of the Licensor,\n      except as required for reasonable and customary use in describing the\n      origin of the Work and reproducing the content of the NOTICE file.\n\n   7. Disclaimer of Warranty. Unless required by applicable law or\n      agreed to in writing, Licensor provides the Work (and each\n      Contributor provides its Contributions) on an \"AS IS\" BASIS,\n      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n      implied, including, without limitation, any warranties or conditions\n      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n      PARTICULAR PURPOSE. You are solely responsible for determining the\n      appropriateness of using or redistributing the Work and assume any\n      risks associated with Your exercise of permissions under this License.\n\n   8. Limitation of Liability. In no event and under no legal theory,\n      whether in tort (including negligence), contract, or otherwise,\n      unless required by applicable law (such as deliberate and grossly\n      negligent acts) or agreed to in writing, shall any Contributor be\n      liable to You for damages, including any direct, indirect, special,\n      incidental, or consequential damages of any character arising as a\n      result of this License or out of the use or inability to use the\n      Work (including but not limited to damages for loss of goodwill,\n      work stoppage, computer failure or malfunction, or any and all\n      other commercial damages or losses), even if such Contributor\n      has been advised of the possibility of such damages.\n\n   9. Accepting Warranty or Additional Liability. While redistributing\n      the Work or Derivative Works thereof, You may choose to offer,\n      and charge a fee for, acceptance of support, warranty, indemnity,\n      or other liability obligations and/or rights consistent with this\n      License. However, in accepting such obligations, You may act only\n      on Your own behalf and on Your sole responsibility, not on behalf\n      of any other Contributor, and only if You agree to indemnify,\n      defend, and hold each Contributor harmless for any liability\n      incurred by, or claims asserted against, such Contributor by reason\n      of your accepting any such warranty or additional liability.\n\n   END OF TERMS AND CONDITIONS\n\n   APPENDIX: How to apply the Apache License to your work.\n\n      To apply the Apache License to your work, attach the following\n      boilerplate notice, with the fields enclosed by brackets \"[]\"\n      replaced with your own identifying information. (Don't include\n      the brackets!)  The text should be enclosed in the appropriate\n      comment syntax for the file format. We also recommend that a\n      file or class name and description of purpose be included on the\n      same \"printed page\" as the copyright notice for easier\n      identification within third-party archives.\n\n   Copyright [yyyy] [name of copyright owner]\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n"
  },
  {
    "path": "README.md",
    "content": "# nats-docker\n\n[![License][License-Image]][License-Url]\n\nThis is the repository for building the official [NATS server Docker images]. If you\njust want to use NATS server, then head over to [Docker Hub]. You don't need\nthis repository.\n\nThe rest of this readme is for image maintainers.\n\n## Directory structure\n\nThe directories are structured in a way such that each NATS server release has\na directory. Each release version has a number of base image variants, such as\nscratch on Linux or nanoserver on Windows.\n\n```\nnats-docker/\n├── 2.9.x\n│   ├── image variant 1\n└───└── image variant 2\n├── 2.10.x\n│   ├── image variant 1\n└───└── image variant 2\n```\n\nFor the most part, image variant Dockerfiles will download the official NATS\nserver [release binaries] when building the server image and `COPY` a default\nconfiguration file.\n\nThe Linux scratch image is a little special. It copies a server binary from the\nAlpine image because the scratch image doesn't come with any tools to download\nand untar binaries.\n\n## Updating NATS server version\n\nFirst, make sure you've published a new NATS server git tag and make sure the\n[release binaries] and SHASUMS are ready to download.\n\nNext, run the command below. This will update the version and hash of the NATS\nserver. If this is a patch release, it will update the existing directory.\nHowever, if it is a minor or major version, it will create the new directory\n(if required) from the latest minor version.\n\n```\nusage: ./update.py <server version>\n       ./update.py 2.10.0\n```\n\nYou can check what changed with `git diff`.\n\n## Manual updates\n\nThis script doesn't update everything. Here are some other things you\nmay or may not want to update.\n\n- The Ubuntu host version used for CI.\n- The Windows host versions used for CI.\n- The Alpine version\n\nAfter you've updated everything that needs updating. Submit a PR to this repo.\nMake sure CI passes.\n\n## Publishing on Docker Hub\n\nTo publish your new changes to Docker Hub. Head over to\n[docker-library/official-images]. You'll need to update the [nats IMF] file.\n\nIMF stands for Internet Message Format. It's the format that Docker chose to\ndeclare images, instead of something like YAML.\n\nYou'll need to update the git commit in this file.\n\n```\nGitCommit: 710f0ed18645d78e97fa7fd8cdf9b80dbe936eb6\n```\n\nAlso handy to know, if you're testing and haven't merged your PR in\nnats-io/nats-docker. You can tell Docker to pull a commit from a different\nbranch like this.\n\n```\nGitFetch: refs/heads/mybranch\nGitCommit: 710f0ed18645d78e97fa7fd8cdf9b80dbe936eb6\n```\n\nDocker images will be built in the order they're specified in the IMF file.\nThis detail is very important because Windows images and the scratch image\ndepend on this behavior. Nanoserver images must be built after servercore\nimages. Scratch must be built after Alpine.\n\n```\nTags: 2.1.0-windowsservercore-1809, windowsservercore-1809\nArchitectures: windows-amd64\nDirectory: 2.1.0/windowsservercore-1809\nConstraints: windowsservercore-1809\n\nTags: 2.1.0-nanoserver-1809, nanoserver-1809\nArchitectures: windows-amd64\nDirectory: 2.1.0/nanoserver-1809\nConstraints: nanoserver-1809, windowsservercore-1809\n```\n\nThe names of the images also have to be consistent with the rest of the\nofficial images. Make sure the names match existing image names. For example,\nit should be `2.1.0-windowsservercore-1809`, not `2.1.0-windowsservercore1809`,\nnot `2.1.0-servercore-1809`.\n\n[Docker Hub]: https://hub.docker.com/_/nats\n[docker-library/official-images]: https://github.com/docker-library/official-images\n[License-Image]: https://img.shields.io/badge/License-Apache2-blue.svg\n[License-Url]: https://www.apache.org/licenses/LICENSE-2.0\n[nats IMF]: https://github.com/docker-library/official-images/blob/master/library/nats\n[NATS server Docker images]: https://hub.docker.com/_/nats\n[release binaries]: https://github.com/nats-io/nats-server/releases\n"
  },
  {
    "path": "update.py",
    "content": "#!/usr/bin/env python3\n\nimport os\nimport re\nimport sys\nimport glob\nimport shutil\nimport typing\nimport urllib.request\n\nsemver_str = r\"([0-9]+)\\.([0-9]+)\\.([0-9]+)(-(preview|rc|RC)\\.([0-9]+))?\"\nsha256_str = r\"[A-Fa-f0-9]{64}\"\ndefault_sha256 = \"0000000000000000000000000000000000000000000000000000000000000000\"\n\n\n# Update the NATS_SERVER env variable across applicable files.\ndef update_env_var(base_dir: str, new_ver: str):\n    files = [\n        f\"./{base_dir}/windowsservercore-ltsc2022/Dockerfile\",\n        f\"./{base_dir}/windowsservercore-ltsc2025/Dockerfile\",\n        f\"./{base_dir}/tests/build-images.sh\",\n        f\"./{base_dir}/tests/run-images.sh\",\n        f\"./{base_dir}/tests/build-images-ltsc2022.ps1\",\n        f\"./{base_dir}/tests/build-images-ltsc2025.ps1\",\n        f\"./{base_dir}/tests/run-images-ltsc2022.ps1\",\n        f\"./{base_dir}/tests/run-images-ltsc2025.ps1\",\n    ] +  glob.glob(f\"./{base_dir}/alpine*/Dockerfile\")\n\n    r = re.compile(r\"(NATS_SERVER )\" + semver_str)\n\n    for f in files:\n        with open(f, \"r\") as fd:\n            data = fd.read()\n\n        with open(f, \"w\") as fd:\n            fd.write(r.sub(f\"\\g<1>{new_ver}\", data))\n\n\n# Update the nats:x.y.z tag across applicable files.\ndef update_tag_var(base_dir: str, new_ver: str):\n    files = [\n        f\"./{base_dir}/nanoserver-ltsc2022/Dockerfile\",\n        f\"./{base_dir}/nanoserver-ltsc2025/Dockerfile\",\n        f\"./{base_dir}/scratch/Dockerfile\",\n    ]\n\n    r = re.compile(r\"(--from=nats:)\" + semver_str)\n\n    for f in files:\n        with open(f, \"r\") as fd:\n            data = fd.read()\n\n        with open(f, \"w\") as fd:\n            fd.write(r.sub(f\"\\g<1>{new_ver}\", data))\n\n\n# Update the nats:x.y.z tag across applicable files.\ndef update_preview_tag_var(base_dir: str, new_ver: str):\n    files = [\n        f\"./{base_dir}/nanoserver-ltsc2022/Dockerfile.preview\",\n        f\"./{base_dir}/nanoserver-ltsc2025/Dockerfile.preview\",\n        f\"./{base_dir}/scratch/Dockerfile.preview\",\n    ]\n\n    r = re.compile(r\"(BASE_IMAGE=nats:)\" + semver_str)\n\n    for f in files:\n        with open(f, \"r\") as fd:\n            data = fd.read()\n\n        with open(f, \"w\") as fd:\n            fd.write(r.sub(f\"\\g<1>{new_ver}\", data))\n\n\n# Update the NATS SHASUM across applicable files.\ndef update_windows_shasums(base_dir: str, new_ver: str, shasums: typing.Dict):\n    files = [\n        f\"{base_dir}/windowsservercore-ltsc2022/Dockerfile\",\n        f\"{base_dir}/windowsservercore-ltsc2025/Dockerfile\",\n    ]\n\n    key = f\"nats-server-v{new_ver}-windows-amd64.zip\"\n    sha = shasums.get(key, default_sha256)\n\n    r = re.compile(r\"(NATS_SERVER_SHASUM )\" + sha256_str)\n\n    for f in files:\n        with open(f, \"r\") as fd:\n            data = fd.read()\n\n        with open(f, \"w\") as fd:\n            fd.write(r.sub(f\"\\g<1>{sha}\", data))\n\n\ndef update_alpine_shasums(base_dir: str, new_ver: str, shasums: typing.Dict):\n    file = glob.glob(f\"{base_dir}/alpine*/Dockerfile\")[0]\n\n    with open(file, \"r\") as fd:\n        data = fd.read()\n\n    arches = (\"arm64\", \"arm6\", \"arm7\", \"amd64\", \"386\", \"s390x\", \"ppc64le\")\n    if base_dir != \"2.10.x\":\n        arches += (\"loong64\",)\n\n    for arch in arches:\n        key = f\"nats-server-v{new_ver}-linux-{arch}.tar.gz\"\n        arch_sha = shasums.get(key, default_sha256)\n        r = re.compile(f\"(natsArch='{arch}'; )\"+r\"sha256='\" + sha256_str + r\"'\")\n        data = r.sub(f\"\\g<1>sha256='{arch_sha}'\", data)\n\n    with open(file, \"w\") as fd:\n        fd.write(data)\n\n\ndef get_shasums(ver: str) -> typing.Dict:\n    u = f\"https://github.com/nats-io/nats-server/releases/download/v{ver}/SHA256SUMS\"\n\n    d = {}\n    try:\n        with urllib.request.urlopen(u) as resp:\n            data = resp.readlines()\n\n        for line in data:\n            sps = line.split()\n            if len(sps) != 2:\n                continue\n            d[sps[1].decode(\"utf-8\")] = sps[0].decode(\"utf-8\")\n    except Exception as e:\n        pass\n\n    return d\n\n\n# Get the base version directory for the new version.\ndef get_base_version(cdir: str, maj_ver: int, min_ver: int) -> str:\n    r = re.compile(r\"[0-9]+\\.[0-9]+\\.x\")\n\n    base_dir = None\n    for f in os.listdir(base_dir):\n        if not r.search(f):\n            continue\n\n        toks = f.split(\".\")\n        if len(toks) != 3:\n            continue\n\n        # Explicit match on major and minor.\n        # First precedence.\n        if int(toks[0]) == maj_ver and int(toks[1]) == min_ver:\n            return f\n\n        # Directory has prior minor version.\n        # Second precedence.\n        if int(toks[0]) == maj_ver and int(toks[1]) == (min_ver - 1):\n            base_dir = f\n\n        # Directory has prior major version.\n        # Third precedence.\n        if not base_dir and int(toks[0]) == (maj_ver - 1):\n            base_dir = f\n\n    return base_dir\n\n\ndef ensure_dir(base_dir: str, maj_ver: int, min_ver: int) -> str:\n    # Already exists, use that minor directory.\n    if os.path.exists(f\"{maj_ver}.{min_ver}.x\"):\n        return f\"{maj_ver}.{min_ver}.x\"\n\n    # Create and copy the directory.\n    shutil.copytree(base_dir, f\"{maj_ver}.{min_ver}.x\", symlinks=True)\n\n    return f\"{maj_ver}.{min_ver}.x\"\n\n\nif __name__ == \"__main__\":\n    if len(sys.argv) != 2:\n       print(f\"usage: {sys.argv[0]} <version>\")\n       sys.exit(1)\n\n    new_ver = sys.argv[1]\n    if not re.compile(semver_str).match(new_ver):\n        print(f\"invalid version: {new_ver}\")\n        sys.exit(1)\n\n    toks = new_ver.split(\".\")\n    maj_ver = int(toks[0])\n    min_ver = int(toks[1])\n\n    base_dir = get_base_version(\".\", maj_ver, min_ver)\n    if not base_dir:\n        print(f\"unable to find base version for {maj_ver}.{min_ver}.x\")\n        sys.exit(1)\n\n    print(f\"base dir: {base_dir}\")\n    print(f\"new version: {new_ver}\")\n\n    print(\"downloading binary release shasums...\")\n    shasums = get_shasums(new_ver)\n\n    # Ensure the new directory exists.\n    base_dir = ensure_dir(base_dir, maj_ver, min_ver)\n\n    print(\"updating local files...\")\n    update_env_var(base_dir, new_ver)\n    update_tag_var(base_dir, new_ver)\n    update_preview_tag_var(base_dir, new_ver)\n\n    update_windows_shasums(base_dir, new_ver, shasums)\n    update_alpine_shasums(base_dir, new_ver, shasums)\n\n    print(\"update complete\")\n"
  }
]