Full Code of nats-io/nats-docker for AI

main 2cca6ca2e5e1 cached
93 files
96.5 KB
32.4k tokens
8 symbols
1 requests
Download .txt
Repository: nats-io/nats-docker
Branch: main
Commit: 2cca6ca2e5e1
Files: 93
Total size: 96.5 KB

Directory structure:
gitextract_6w3j__g3/

├── .github/
│   └── workflows/
│       ├── images.yaml
│       └── main.yaml
├── 2.10.x/
│   ├── alpine3.22/
│   │   ├── Dockerfile
│   │   ├── docker-entrypoint.sh
│   │   └── nats-server.conf
│   ├── nanoserver-ltsc2022/
│   │   ├── Dockerfile
│   │   ├── Dockerfile.preview
│   │   └── nats-server.conf
│   ├── nanoserver-ltsc2025/
│   │   ├── Dockerfile
│   │   ├── Dockerfile.preview
│   │   └── nats-server.conf
│   ├── scratch/
│   │   ├── Dockerfile
│   │   ├── Dockerfile.preview
│   │   └── nats-server.conf
│   ├── tests/
│   │   ├── build-images-ltsc2022.ps1
│   │   ├── build-images-ltsc2025.ps1
│   │   ├── build-images.sh
│   │   ├── run-images-ltsc2022.ps1
│   │   ├── run-images-ltsc2025.ps1
│   │   └── run-images.sh
│   ├── windowsservercore-ltsc2022/
│   │   ├── Dockerfile
│   │   └── nats-server.conf
│   └── windowsservercore-ltsc2025/
│       ├── Dockerfile
│       └── nats-server.conf
├── 2.11.x/
│   ├── alpine3.22/
│   │   ├── Dockerfile
│   │   ├── docker-entrypoint.sh
│   │   └── nats-server.conf
│   ├── nanoserver-ltsc2022/
│   │   ├── Dockerfile
│   │   ├── Dockerfile.preview
│   │   └── nats-server.conf
│   ├── nanoserver-ltsc2025/
│   │   ├── Dockerfile
│   │   ├── Dockerfile.preview
│   │   └── nats-server.conf
│   ├── scratch/
│   │   ├── Dockerfile
│   │   ├── Dockerfile.preview
│   │   └── nats-server.conf
│   ├── tests/
│   │   ├── build-images-ltsc2022.ps1
│   │   ├── build-images-ltsc2025.ps1
│   │   ├── build-images.sh
│   │   ├── run-images-ltsc2022.ps1
│   │   ├── run-images-ltsc2025.ps1
│   │   └── run-images.sh
│   ├── windowsservercore-ltsc2022/
│   │   ├── Dockerfile
│   │   └── nats-server.conf
│   └── windowsservercore-ltsc2025/
│       ├── Dockerfile
│       └── nats-server.conf
├── 2.12.x/
│   ├── alpine3.22/
│   │   ├── Dockerfile
│   │   ├── docker-entrypoint.sh
│   │   └── nats-server.conf
│   ├── nanoserver-ltsc2022/
│   │   ├── Dockerfile
│   │   ├── Dockerfile.preview
│   │   └── nats-server.conf
│   ├── nanoserver-ltsc2025/
│   │   ├── Dockerfile
│   │   ├── Dockerfile.preview
│   │   └── nats-server.conf
│   ├── scratch/
│   │   ├── Dockerfile
│   │   ├── Dockerfile.preview
│   │   └── nats-server.conf
│   ├── tests/
│   │   ├── build-images-ltsc2022.ps1
│   │   ├── build-images-ltsc2025.ps1
│   │   ├── build-images.sh
│   │   ├── run-images-ltsc2022.ps1
│   │   ├── run-images-ltsc2025.ps1
│   │   └── run-images.sh
│   ├── windowsservercore-ltsc2022/
│   │   ├── Dockerfile
│   │   └── nats-server.conf
│   └── windowsservercore-ltsc2025/
│       ├── Dockerfile
│       └── nats-server.conf
├── 2.14.x/
│   ├── alpine3.22/
│   │   ├── Dockerfile
│   │   ├── docker-entrypoint.sh
│   │   └── nats-server.conf
│   ├── nanoserver-ltsc2022/
│   │   ├── Dockerfile
│   │   ├── Dockerfile.preview
│   │   └── nats-server.conf
│   ├── nanoserver-ltsc2025/
│   │   ├── Dockerfile
│   │   ├── Dockerfile.preview
│   │   └── nats-server.conf
│   ├── scratch/
│   │   ├── Dockerfile
│   │   ├── Dockerfile.preview
│   │   └── nats-server.conf
│   ├── tests/
│   │   ├── build-images-ltsc2022.ps1
│   │   ├── build-images-ltsc2025.ps1
│   │   ├── build-images.sh
│   │   ├── run-images-ltsc2022.ps1
│   │   ├── run-images-ltsc2025.ps1
│   │   └── run-images.sh
│   ├── windowsservercore-ltsc2022/
│   │   ├── Dockerfile
│   │   └── nats-server.conf
│   └── windowsservercore-ltsc2025/
│       ├── Dockerfile
│       └── nats-server.conf
├── LICENSE
├── README.md
└── update.py

================================================
FILE CONTENTS
================================================

================================================
FILE: .github/workflows/images.yaml
================================================
name: Build Images

on:
  push:
    tags:
      - "*"

permissions:
  contents: read

env:
  IMAGE_NAME: "synadia/nats-server"
  LINUX_ARCHS_2_10: "linux/arm64,linux/arm/v6,linux/arm/v7,linux/amd64,linux/386,linux/s390x,linux/ppc64le"
  LINUX_ARCHS: "linux/arm64,linux/arm/v6,linux/arm/v7,linux/amd64,linux/386,linux/s390x,linux/ppc64le"

jobs:
  linux-2_10:
    name: Build Linux (2.10.x)
    if: ${{ startsWith(github.ref_name,  'v2.10.') }}
    runs-on: ubuntu-latest

    steps:
      - name: Checkout repository
        uses: actions/checkout@v4

      - name: Log into Docker
        uses: docker/login-action@v3
        with:
          username: ${{ secrets.DOCKER_USERNAME }}
          password: ${{ secrets.DOCKER_TOKEN }}

      - name: Set up Docker Buildx
        uses: docker/setup-buildx-action@v3

        # https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#setting-an-output-parameter
      - name: Tag Version
        id: ref
        shell: bash
        run: |
          TAG=${{ github.ref_name }}
          echo "TAG=${TAG#v}" >> "$GITHUB_OUTPUT"

      - name: Alpine
        uses: docker/build-push-action@v6
        with:
          context: ./2.10.x/alpine3.22/
          platforms: ${{ env.LINUX_ARCHS_2_10 }}
          push: true
          tags: ${{ env.IMAGE_NAME }}:${{ steps.ref.outputs.TAG }}-alpine3.22
          provenance: mode=max

      - name: Scratch
        uses: docker/build-push-action@v6
        with:
          context: ./2.10.x/scratch/
          file: ./2.10.x/scratch/Dockerfile.preview
          platforms: ${{ env.LINUX_ARCHS_2_10 }}
          push: true
          tags: ${{ env.IMAGE_NAME }}:${{ steps.ref.outputs.TAG }}-scratch
          provenance: mode=max
          build-args: |
            BASE_IMAGE=${{ env.IMAGE_NAME }}:${{ steps.ref.outputs.TAG }}-alpine3.22

  windows-2_10:
    name: Test Windows Server LTSC ${{ matrix.ltsc }} (${{ matrix.version }})
    if: ${{ startsWith(github.ref_name,  'v2.10.') }}
    runs-on: windows-${{ matrix.ltsc }}
    strategy:
      fail-fast: false
      matrix:
        version:
          - 2.10.x
        ltsc:
          - 2022
          # - 2025

    steps:
      - name: Checkout repository
        uses: actions/checkout@v4

      - name: Log into Docker
        uses: docker/login-action@v3
        with:
          username: ${{ secrets.DOCKER_USERNAME }}
          password: ${{ secrets.DOCKER_TOKEN }}

        # NOTE: bash is supported on Windows runners
        # https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#setting-an-output-parameter
      - name: Tag Version
        id: ref
        shell: bash
        run: |
          TAG=${{ github.ref_name }}
          echo "TAG=${TAG#v}" >> "$GITHUB_OUTPUT"

        # Buildx is not supported on Windows yet.
      - name: windowsservercore-ltsc${{ matrix.ltsc }}
        shell: pwsh
        run: |
          docker build `
            --tag "${{ env.IMAGE_NAME }}:${{ steps.ref.outputs.TAG }}-windowsservercore-ltsc${{ matrix.ltsc }}" `
            ./${{ matrix.version }}/windowsservercore-ltsc${{ matrix.ltsc }}

          docker push "${{ env.IMAGE_NAME }}:${{ steps.ref.outputs.TAG }}-windowsservercore-ltsc${{ matrix.ltsc }}"

      - name: nanoserver-ltsc${{ matrix.ltsc }}
        shell: pwsh
        run: |
          docker build `
            --file ./${{ matrix.version }}/nanoserver-ltsc${{ matrix.ltsc }}/Dockerfile.preview `
            --build-arg "BASE_IMAGE=${{ env.IMAGE_NAME }}:${{ steps.ref.outputs.TAG }}-windowsservercore-ltsc${{ matrix.ltsc }}" `
            --tag "${{ env.IMAGE_NAME }}:${{ steps.ref.outputs.TAG }}-nanoserver-ltsc${{ matrix.ltsc }}" `
            ./${{ matrix.version }}/nanoserver-ltsc${{ matrix.ltsc }}

          docker push "${{ env.IMAGE_NAME }}:${{ steps.ref.outputs.TAG }}-nanoserver-ltsc${{ matrix.ltsc }}"

  linux-2_11:
    name: Build Linux (2.11.x)
    if: ${{ startsWith(github.ref_name,  'v2.11.') }}
    runs-on: ubuntu-latest

    steps:
      - name: Checkout repository
        uses: actions/checkout@v4

      - name: Log into Docker
        uses: docker/login-action@v3
        with:
          username: ${{ secrets.DOCKER_USERNAME }}
          password: ${{ secrets.DOCKER_TOKEN }}

      - name: Set up Docker Buildx
        uses: docker/setup-buildx-action@v3

      - name: Tag Version
        id: ref
        shell: bash
        run: |
          TAG=${{ github.ref_name }}
          echo "TAG=${TAG#v}" >> "$GITHUB_OUTPUT"

      - name: Alpine
        uses: docker/build-push-action@v6
        with:
          context: ./2.11.x/alpine3.22/
          platforms: ${{ env.LINUX_ARCHS }}
          push: true
          tags: ${{ env.IMAGE_NAME }}:${{ steps.ref.outputs.TAG }}-alpine3.22
          provenance: mode=max

      - name: Scratch
        uses: docker/build-push-action@v6
        with:
          context: ./2.11.x/scratch/
          file: ./2.11.x/scratch/Dockerfile.preview
          platforms: ${{ env.LINUX_ARCHS }}
          push: true
          tags: ${{ env.IMAGE_NAME }}:${{ steps.ref.outputs.TAG }}-scratch
          provenance: mode=max
          build-args: |
            BASE_IMAGE=${{ env.IMAGE_NAME }}:${{ steps.ref.outputs.TAG }}-alpine3.22

  windows-2_11:
    name: Test Windows Server LTSC ${{ matrix.ltsc }} (${{ matrix.version }})
    if: ${{ startsWith(github.ref_name,  'v2.11.') }}
    runs-on: windows-${{ matrix.ltsc }}
    strategy:
      fail-fast: false
      matrix:
        version:
          - 2.11.x
        ltsc:
          - 2022
          # - 2025

    steps:
      - name: Checkout repository
        uses: actions/checkout@v4

      - name: Log into Docker
        uses: docker/login-action@v3
        with:
          username: ${{ secrets.DOCKER_USERNAME }}
          password: ${{ secrets.DOCKER_TOKEN }}

        # NOTE: bash is supported on Windows runners
        # https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#setting-an-output-parameter
      - name: Tag Version
        id: ref
        shell: bash
        run: |
          TAG=${{ github.ref_name }}
          echo "TAG=${TAG#v}" >> "$GITHUB_OUTPUT"

        # Buildx is not supported on Windows yet.
      - name: windowsservercore-ltsc${{ matrix.ltsc }}
        shell: pwsh
        run: |
          docker build `
            --tag "${{ env.IMAGE_NAME }}:${{ steps.ref.outputs.TAG }}-windowsservercore-ltsc${{ matrix.ltsc }}" `
            ./${{ matrix.version }}/windowsservercore-ltsc${{ matrix.ltsc }}

          docker push "${{ env.IMAGE_NAME }}:${{ steps.ref.outputs.TAG }}-windowsservercore-ltsc${{ matrix.ltsc }}"

      - name: nanoserver-ltsc${{ matrix.ltsc }}
        shell: pwsh
        run: |
          docker build `
            --file ./${{ matrix.version }}/nanoserver-ltsc${{ matrix.ltsc }}/Dockerfile.preview `
            --build-arg "BASE_IMAGE=${{ env.IMAGE_NAME }}:${{ steps.ref.outputs.TAG }}-windowsservercore-ltsc${{ matrix.ltsc }}" `
            --tag "${{ env.IMAGE_NAME }}:${{ steps.ref.outputs.TAG }}-nanoserver-ltsc${{ matrix.ltsc }}" `
            ./${{ matrix.version }}/nanoserver-ltsc${{ matrix.ltsc }}

          docker push "${{ env.IMAGE_NAME }}:${{ steps.ref.outputs.TAG }}-nanoserver-ltsc${{ matrix.ltsc }}"

  linux-2_12:
    name: Build Linux (2.12.x)
    if: ${{ startsWith(github.ref_name,  'v2.12.') }}
    runs-on: ubuntu-latest

    steps:
      - name: Checkout repository
        uses: actions/checkout@v4

      - name: Log into Docker
        uses: docker/login-action@v3
        with:
          username: ${{ secrets.DOCKER_USERNAME }}
          password: ${{ secrets.DOCKER_TOKEN }}

      - name: Set up Docker Buildx
        uses: docker/setup-buildx-action@v3

      - name: Tag Version
        id: ref
        shell: bash
        run: |
          TAG=${{ github.ref_name }}
          echo "TAG=${TAG#v}" >> "$GITHUB_OUTPUT"

      - name: Alpine
        uses: docker/build-push-action@v6
        with:
          context: ./2.12.x/alpine3.22/
          platforms: ${{ env.LINUX_ARCHS }}
          push: true
          tags: ${{ env.IMAGE_NAME }}:${{ steps.ref.outputs.TAG }}-alpine3.22
          provenance: mode=max

      - name: Scratch
        uses: docker/build-push-action@v6
        with:
          context: ./2.12.x/scratch/
          file: ./2.12.x/scratch/Dockerfile.preview
          platforms: ${{ env.LINUX_ARCHS }}
          push: true
          tags: ${{ env.IMAGE_NAME }}:${{ steps.ref.outputs.TAG }}-scratch
          provenance: mode=max
          build-args: |
            BASE_IMAGE=${{ env.IMAGE_NAME }}:${{ steps.ref.outputs.TAG }}-alpine3.22

  windows-2_12:
    name: Test Windows Server LTSC ${{ matrix.ltsc }} (${{ matrix.version }})
    if: ${{ startsWith(github.ref_name,  'v2.12.') }}
    runs-on: windows-${{ matrix.ltsc }}
    strategy:
      fail-fast: false
      matrix:
        version:
          - 2.12.x
        ltsc:
          - 2022
          # - 2025

    steps:
      - name: Checkout repository
        uses: actions/checkout@v4

      - name: Log into Docker
        uses: docker/login-action@v3
        with:
          username: ${{ secrets.DOCKER_USERNAME }}
          password: ${{ secrets.DOCKER_TOKEN }}

        # NOTE: bash is supported on Windows runners
        # https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#setting-an-output-parameter
      - name: Tag Version
        id: ref
        shell: bash
        run: |
          TAG=${{ github.ref_name }}
          echo "TAG=${TAG#v}" >> "$GITHUB_OUTPUT"

        # Buildx is not supported on Windows yet.
      - name: windowsservercore-ltsc${{ matrix.ltsc }}
        shell: pwsh
        run: |
          docker build `
            --tag "${{ env.IMAGE_NAME }}:${{ steps.ref.outputs.TAG }}-windowsservercore-ltsc${{ matrix.ltsc }}" `
            ./${{ matrix.version }}/windowsservercore-ltsc${{ matrix.ltsc }}

          docker push "${{ env.IMAGE_NAME }}:${{ steps.ref.outputs.TAG }}-windowsservercore-ltsc${{ matrix.ltsc }}"

      - name: nanoserver-ltsc${{ matrix.ltsc }}
        shell: pwsh
        run: |
          docker build `
            --file ./${{ matrix.version }}/nanoserver-ltsc${{ matrix.ltsc }}/Dockerfile.preview `
            --build-arg "BASE_IMAGE=${{ env.IMAGE_NAME }}:${{ steps.ref.outputs.TAG }}-windowsservercore-ltsc${{ matrix.ltsc }}" `
            --tag "${{ env.IMAGE_NAME }}:${{ steps.ref.outputs.TAG }}-nanoserver-ltsc${{ matrix.ltsc }}" `
            ./${{ matrix.version }}/nanoserver-ltsc${{ matrix.ltsc }}

          docker push "${{ env.IMAGE_NAME }}:${{ steps.ref.outputs.TAG }}-nanoserver-ltsc${{ matrix.ltsc }}"

  linux-2_14:
    name: Build Linux (2.14.x)
    if: ${{ startsWith(github.ref_name,  'v2.14.') }}
    runs-on: ubuntu-latest

    steps:
      - name: Checkout repository
        uses: actions/checkout@v4

      - name: Log into Docker
        uses: docker/login-action@v3
        with:
          username: ${{ secrets.DOCKER_USERNAME }}
          password: ${{ secrets.DOCKER_TOKEN }}

      - name: Set up Docker Buildx
        uses: docker/setup-buildx-action@v3

      - name: Tag Version
        id: ref
        shell: bash
        run: |
          TAG=${{ github.ref_name }}
          echo "TAG=${TAG#v}" >> "$GITHUB_OUTPUT"

      - name: Alpine
        uses: docker/build-push-action@v6
        with:
          context: ./2.14.x/alpine3.22/
          platforms: ${{ env.LINUX_ARCHS }}
          push: true
          tags: ${{ env.IMAGE_NAME }}:${{ steps.ref.outputs.TAG }}-alpine3.22
          provenance: mode=max

      - name: Scratch
        uses: docker/build-push-action@v6
        with:
          context: ./2.14.x/scratch/
          file: ./2.14.x/scratch/Dockerfile.preview
          platforms: ${{ env.LINUX_ARCHS }}
          push: true
          tags: ${{ env.IMAGE_NAME }}:${{ steps.ref.outputs.TAG }}-scratch
          provenance: mode=max
          build-args: |
            BASE_IMAGE=${{ env.IMAGE_NAME }}:${{ steps.ref.outputs.TAG }}-alpine3.22

  windows-2_14:
    name: Test Windows Server LTSC ${{ matrix.ltsc }} (${{ matrix.version }})
    if: ${{ startsWith(github.ref_name,  'v2.14.') }}
    runs-on: windows-${{ matrix.ltsc }}
    strategy:
      fail-fast: false
      matrix:
        version:
          - 2.14.x
        ltsc:
          - 2022
          # - 2025

    steps:
      - name: Checkout repository
        uses: actions/checkout@v4

      - name: Log into Docker
        uses: docker/login-action@v3
        with:
          username: ${{ secrets.DOCKER_USERNAME }}
          password: ${{ secrets.DOCKER_TOKEN }}

        # NOTE: bash is supported on Windows runners
        # https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#setting-an-output-parameter
      - name: Tag Version
        id: ref
        shell: bash
        run: |
          TAG=${{ github.ref_name }}
          echo "TAG=${TAG#v}" >> "$GITHUB_OUTPUT"

        # Buildx is not supported on Windows yet.
      - name: windowsservercore-ltsc${{ matrix.ltsc }}
        shell: pwsh
        run: |
          docker build `
            --tag "${{ env.IMAGE_NAME }}:${{ steps.ref.outputs.TAG }}-windowsservercore-ltsc${{ matrix.ltsc }}" `
            ./${{ matrix.version }}/windowsservercore-ltsc${{ matrix.ltsc }}

          docker push "${{ env.IMAGE_NAME }}:${{ steps.ref.outputs.TAG }}-windowsservercore-ltsc${{ matrix.ltsc }}"

      - name: nanoserver-ltsc${{ matrix.ltsc }}
        shell: pwsh
        run: |
          docker build `
            --file ./${{ matrix.version }}/nanoserver-ltsc${{ matrix.ltsc }}/Dockerfile.preview `
            --build-arg "BASE_IMAGE=${{ env.IMAGE_NAME }}:${{ steps.ref.outputs.TAG }}-windowsservercore-ltsc${{ matrix.ltsc }}" `
            --tag "${{ env.IMAGE_NAME }}:${{ steps.ref.outputs.TAG }}-nanoserver-ltsc${{ matrix.ltsc }}" `
            ./${{ matrix.version }}/nanoserver-ltsc${{ matrix.ltsc }}

          docker push "${{ env.IMAGE_NAME }}:${{ steps.ref.outputs.TAG }}-nanoserver-ltsc${{ matrix.ltsc }}"


================================================
FILE: .github/workflows/main.yaml
================================================
name: Docker build testing
on: [push, pull_request]

permissions:
  contents: read

jobs:
  linux:
    name: Test Linux (${{ matrix.version }})
    runs-on: ubuntu-latest
    strategy:
      fail-fast: false
      matrix:
        version:
          - 2.10.x
          - 2.11.x
          - 2.12.x
          - 2.14.x
    steps:
      - name: Checkout code
        uses: actions/checkout@v1
      - name: Build ${{ matrix.version }} images
        run: |
          cd ./${{ matrix.version }}/tests && ./build-images.sh
      - name: Test ${{ matrix.version }} images
        run: |
          cd ./${{ matrix.version }}/tests && ./run-images.sh

  windows:
    name: Test Windows Server LTSC ${{ matrix.ltsc }} (${{ matrix.version }})
    runs-on: windows-${{ matrix.ltsc }}
    strategy:
      fail-fast: false
      matrix:
        version:
          - 2.10.x
          - 2.11.x
          - 2.12.x
          - 2.14.x
        ltsc:
          - 2022
          # - 2025
    steps:
      - name: Checkout code
        uses: actions/checkout@v1
      - name: Build images
        shell: powershell
        run: |
          cd ./${{ matrix.version }}/tests; ./build-images-ltsc${{ matrix.ltsc }}.ps1
      - name: Test images
        shell: powershell
        run: |
          cd ./${{ matrix.version }}/tests; ./run-images-ltsc${{ matrix.ltsc }}.ps1


================================================
FILE: 2.10.x/alpine3.22/Dockerfile
================================================
FROM alpine:3.22

ENV NATS_SERVER 2.10.29

RUN set -eux; \
	apkArch="$(apk --print-arch)"; \
	case "$apkArch" in \
		aarch64) natsArch='arm64'; sha256='da4b27942ecfb4c5f0c54553d2e7f470ddda9d7581cfe8131b351a0e223ed401' ;; \
		armhf) natsArch='arm6'; sha256='7b70fd23bfbd9efa7ca5edb5aa18fe33b07ff993ac86db06372af297bfaf6fab' ;; \
		armv7) natsArch='arm7'; sha256='a59e7336a32ef78b0ca8bc3e6707a5770461d3f45c4c2f96cfef263f26eaefd5' ;; \
		x86_64) natsArch='amd64'; sha256='e314da74a83a1d3876db8814c27eb990fe729640fd6452025b441bcede8390da' ;; \
		x86) natsArch='386'; sha256='abc385394c19784558f7aa2f9770fe2daceb22cf95e3fa398c832590479396b0' ;; \
		s390x) natsArch='s390x'; sha256='ee821b1eae8bb98a0d4603510a41613dd15afef244261a79da33515699d1aece' ;; \
		ppc64le) natsArch='ppc64le'; sha256='31b0063d261e5d8c59396f8a3f9298ad80b36fd4bc370ce59e5d160f55a0fe46' ;; \
		*) echo >&2 "error: $apkArch is not supported!"; exit 1 ;; \
	esac; \
	\
	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"; \
	echo "${sha256} *nats-server.tar.gz" | sha256sum -c -; \
	\
	apk add --no-cache ca-certificates tzdata; \
	\
	tar -xf nats-server.tar.gz; \
	rm nats-server.tar.gz; \
	mv "nats-server-v${NATS_SERVER}-linux-${natsArch}/nats-server" /usr/local/bin; \
	rm -rf "nats-server-v${NATS_SERVER}-linux-${natsArch}";

COPY nats-server.conf /etc/nats/nats-server.conf
COPY docker-entrypoint.sh /usr/local/bin

EXPOSE 4222 8222 6222
ENTRYPOINT ["docker-entrypoint.sh"]
CMD ["nats-server", "--config", "/etc/nats/nats-server.conf"]


================================================
FILE: 2.10.x/alpine3.22/docker-entrypoint.sh
================================================
#!/bin/sh
set -e

# this if will check if the first argument is a flag
# but only works if all arguments require a hyphenated flag
# -v; -SL; -f arg; etc will work, but not arg1 arg2
if [ "$#" -eq 0 ] || [ "${1#-}" != "$1" ]; then
    set -- nats-server "$@"
fi

# else default to run whatever the user wanted like "bash" or "sh"
exec "$@"



================================================
FILE: 2.10.x/alpine3.22/nats-server.conf
================================================
# Client port of 4222 on all interfaces
port: 4222

# HTTP monitoring port
monitor_port: 8222

# This is for clustering multiple servers together.
cluster {
  # It is recommended to set a cluster name
  name: "my_cluster"

  # Route connections to be received on any interface on port 6222
  port: 6222

  # Routes are protected, so need to use them with --routes flag
  # e.g. --routes=nats-route://ruser:T0pS3cr3t@otherdockerhost:6222
  authorization {
    user: ruser
    password: T0pS3cr3t
    timeout: 2
  }

  # Routes are actively solicited and connected to from this server.
  # This Docker image has none by default, but you can pass a
  # flag to the nats-server docker image to create one to an existing server.
  routes = []
}


================================================
FILE: 2.10.x/nanoserver-ltsc2022/Dockerfile
================================================
FROM mcr.microsoft.com/windows/nanoserver:ltsc2022
ENV NATS_DOCKERIZED 1

COPY --from=nats:2.10.29-windowsservercore-ltsc2022 C:\\nats-server.exe C:\\nats-server.exe
COPY nats-server.conf C:\\nats-server.conf

EXPOSE 4222 8222 6222
ENTRYPOINT ["C:\\nats-server.exe"]
CMD ["--config", "nats-server.conf"]


================================================
FILE: 2.10.x/nanoserver-ltsc2022/Dockerfile.preview
================================================
ARG BASE_IMAGE=nats:2.10.29-windowsservercore-ltsc2022
FROM $BASE_IMAGE AS base

FROM mcr.microsoft.com/windows/nanoserver:ltsc2022
ENV NATS_DOCKERIZED 1

COPY --from=base C:\\nats-server.exe C:\\nats-server.exe
COPY nats-server.conf C:\\nats-server.conf

EXPOSE 4222 8222 6222
ENTRYPOINT ["C:\\nats-server.exe"]
CMD ["--config", "nats-server.conf"]


================================================
FILE: 2.10.x/nanoserver-ltsc2022/nats-server.conf
================================================
# Client port of 4222 on all interfaces
port: 4222

# HTTP monitoring port
monitor_port: 8222

# This is for clustering multiple servers together.
cluster {
  # It is recommended to set a cluster name
  name: "my_cluster"

  # Route connections to be received on any interface on port 6222
  port: 6222

  # Routes are protected, so need to use them with --routes flag
  # e.g. --routes=nats-route://ruser:T0pS3cr3t@otherdockerhost:6222
  authorization {
    user: ruser
    password: T0pS3cr3t
    timeout: 2
  }

  # Routes are actively solicited and connected to from this server.
  # This Docker image has none by default, but you can pass a
  # flag to the nats-server docker image to create one to an existing server.
  routes = []
}


================================================
FILE: 2.10.x/nanoserver-ltsc2025/Dockerfile
================================================
FROM mcr.microsoft.com/windows/nanoserver:ltsc2025
ENV NATS_DOCKERIZED 1

COPY --from=nats:2.10.29-windowsservercore-ltsc2025 C:\\nats-server.exe C:\\nats-server.exe
COPY nats-server.conf C:\\nats-server.conf

EXPOSE 4222 8222 6222
ENTRYPOINT ["C:\\nats-server.exe"]
CMD ["--config", "nats-server.conf"]


================================================
FILE: 2.10.x/nanoserver-ltsc2025/Dockerfile.preview
================================================
ARG BASE_IMAGE=nats:2.10.29-windowsservercore-ltsc2025
FROM $BASE_IMAGE AS base

FROM mcr.microsoft.com/windows/nanoserver:ltsc2025
ENV NATS_DOCKERIZED 1

COPY --from=base C:\\nats-server.exe C:\\nats-server.exe
COPY nats-server.conf C:\\nats-server.conf

EXPOSE 4222 8222 6222
ENTRYPOINT ["C:\\nats-server.exe"]
CMD ["--config", "nats-server.conf"]


================================================
FILE: 2.10.x/nanoserver-ltsc2025/nats-server.conf
================================================
# Client port of 4222 on all interfaces
port: 4222

# HTTP monitoring port
monitor_port: 8222

# This is for clustering multiple servers together.
cluster {
  # It is recommended to set a cluster name
  name: "my_cluster"

  # Route connections to be received on any interface on port 6222
  port: 6222

  # Routes are protected, so need to use them with --routes flag
  # e.g. --routes=nats-route://ruser:T0pS3cr3t@otherdockerhost:6222
  authorization {
    user: ruser
    password: T0pS3cr3t
    timeout: 2
  }

  # Routes are actively solicited and connected to from this server.
  # This Docker image has none by default, but you can pass a
  # flag to the nats-server docker image to create one to an existing server.
  routes = []
}


================================================
FILE: 2.10.x/scratch/Dockerfile
================================================
FROM scratch
ENV PATH="$PATH:/"

COPY --from=nats:2.10.29-alpine3.22 /usr/local/bin/nats-server /nats-server
COPY nats-server.conf /nats-server.conf

EXPOSE 4222 8222 6222
ENTRYPOINT ["/nats-server"]
CMD ["--config", "nats-server.conf"]


================================================
FILE: 2.10.x/scratch/Dockerfile.preview
================================================
ARG BASE_IMAGE=nats:2.10.29-alpine3.22
FROM $BASE_IMAGE AS base

FROM scratch
ENV PATH="$PATH:/"

COPY --from=base /usr/local/bin/nats-server /nats-server
COPY nats-server.conf /nats-server.conf

EXPOSE 4222 8222 6222
ENTRYPOINT ["/nats-server"]
CMD ["--config", "nats-server.conf"]


================================================
FILE: 2.10.x/scratch/nats-server.conf
================================================
# Client port of 4222 on all interfaces
port: 4222

# HTTP monitoring port
monitor_port: 8222

# This is for clustering multiple servers together.
cluster {
  # It is recommended to set a cluster name
  name: "my_cluster"

  # Route connections to be received on any interface on port 6222
  port: 6222

  # Routes are protected, so need to use them with --routes flag
  # e.g. --routes=nats-route://ruser:T0pS3cr3t@otherdockerhost:6222
  authorization {
    user: ruser
    password: T0pS3cr3t
    timeout: 2
  }

  # Routes are actively solicited and connected to from this server.
  # This Docker image has none by default, but you can pass a
  # flag to the nats-server docker image to create one to an existing server.
  routes = []
}


================================================
FILE: 2.10.x/tests/build-images-ltsc2022.ps1
================================================
# Show statements as they run.
Set-PSDebug -Trace 2
# Exit on error.
$ErrorActionPreference = "Stop"

$ver = 'NATS_SERVER 2.10.29'.Split(' ')[1]

Write-Output '-- host info ---'
Write-Output $PSVersionTable
Write-Output (Get-WMIObject win32_operatingsystem).name
Write-Output (Get-WMIObject win32_operatingsystem).OSArchitecture

# The windowsservercore images must be built before the nanoserver images.
cd "../windowsservercore-ltsc2022"
Write-Host "building windowsservercore-ltsc2022"
docker build --tag "nats:${ver}-windowsservercore-ltsc2022" .
if ($LASTEXITCODE -ne 0) {
    exit 1
}

cd "../nanoserver-ltsc2022"
Write-Host "building nanoserver-ltsc2022"
docker build --tag "nats:${ver}-nanoserver-ltsc2022" .
if ($LASTEXITCODE -ne 0) {
    exit 1
}

docker images


================================================
FILE: 2.10.x/tests/build-images-ltsc2025.ps1
================================================
# Show statements as they run.
Set-PSDebug -Trace 2
# Exit on error.
$ErrorActionPreference = "Stop"

$ver = 'NATS_SERVER 2.10.29'.Split(' ')[1]

Write-Output '-- host info ---'
Write-Output $PSVersionTable
Write-Output (Get-WMIObject win32_operatingsystem).name
Write-Output (Get-WMIObject win32_operatingsystem).OSArchitecture

# The windowsservercore images must be built before the nanoserver images.
cd "../windowsservercore-ltsc2025"
Write-Host "building windowsservercore-ltsc2025"
docker build --tag "nats:${ver}-windowsservercore-ltsc2025" .
if ($LASTEXITCODE -ne 0) {
    exit 1
}

cd "../nanoserver-ltsc2025"
Write-Host "building nanoserver-ltsc2025"
docker build --tag "nats:${ver}-nanoserver-ltsc2025" .
if ($LASTEXITCODE -ne 0) {
    exit 1
}

docker images


================================================
FILE: 2.10.x/tests/build-images.sh
================================================
#!/usr/bin/env bash
set -ex

ver=(NATS_SERVER 2.10.29)

(
	cd "../alpine3.22"
	docker build --tag nats:${ver[1]}-alpine3.22 .
)

(
	cd "../scratch"
	docker build --tag nats:${ver[1]}-scratch .
)


================================================
FILE: 2.10.x/tests/run-images-ltsc2022.ps1
================================================
# Show statements as they run.
Set-PSDebug -Trace 2
# Exit on error.
$ErrorActionPreference = "Stop"

$ver = "NATS_SERVER 2.10.29".Split(" ")[1]

$images = @(
	"nats:${ver}-windowsservercore-ltsc2022",
	"nats:${ver}-nanoserver-ltsc2022"
)

foreach ($img in $images) {
	Write-Output "running ${img}"
	$runId = & docker run --detach "${img}"
	sleep 1

	Write-Output "checking ${img}"
	docker ps --filter "id=${runId}" --filter "status=running" --quiet
	if ($LASTEXITCODE -ne 0) {
		exit 1
	}
	docker kill $runId
}


================================================
FILE: 2.10.x/tests/run-images-ltsc2025.ps1
================================================
# Show statements as they run.
Set-PSDebug -Trace 2
# Exit on error.
$ErrorActionPreference = "Stop"

$ver = "NATS_SERVER 2.10.29".Split(" ")[1]

$images = @(
	"nats:${ver}-windowsservercore-ltsc2025",
	"nats:${ver}-nanoserver-ltsc2025"
)

foreach ($img in $images) {
	Write-Output "running ${img}"
	$runId = & docker run --detach "${img}"
	sleep 1

	Write-Output "checking ${img}"
	docker logs "$runId"
	docker ps --filter "id=${runId}" --filter "status=running" --quiet
	if ($LASTEXITCODE -ne 0) {
		exit 1
	}
	docker kill $runId
}


================================================
FILE: 2.10.x/tests/run-images.sh
================================================
#!/usr/bin/env bash
set -ex

ver=(NATS_SERVER 2.10.29)

images=(
	"nats:${ver[1]}-alpine3.22"
	"nats:${ver[1]}-scratch"
)

for img in "${images[@]}"; do
	run_id=$(docker run --detach "${img}")
	sleep 1
	test -n "$(docker ps --filter "id=${run_id}" --filter "status=running" --quiet)"
	docker kill "$run_id"
done


================================================
FILE: 2.10.x/windowsservercore-ltsc2022/Dockerfile
================================================
FROM mcr.microsoft.com/windows/servercore:ltsc2022

# Enable exit on error.
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop';"]

ENV NATS_DOCKERIZED 1
ENV NATS_SERVER 2.10.29
ENV NATS_SERVER_DOWNLOAD https://github.com/nats-io/nats-server/releases/download/v${NATS_SERVER}/nats-server-v${NATS_SERVER}-windows-amd64.zip
ENV NATS_SERVER_SHASUM 98657bf4d5a9ce44168c019ba6894cda8e22e6adc8798edc05c168db7262de29

RUN Set-PSDebug -Trace 2

RUN Write-Host ('downloading from {0} ...' -f $env:NATS_SERVER_DOWNLOAD); \
	[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \
	Invoke-WebRequest -Uri $env:NATS_SERVER_DOWNLOAD -OutFile nats.zip; \
	\
	Write-Host ('verifying sha256 ({0}) ...' -f $env:NATS_SERVER_SHASUM); \
	if ((Get-FileHash nats.zip -Algorithm sha256).Hash -ne $env:NATS_SERVER_SHASUM) { \
		Write-Host 'FAILED!'; \
		exit 1; \
	}; \
	Write-Host 'extracting nats.zip'; \
	Expand-Archive -Path 'nats.zip' -DestinationPath .; \
	\
	Write-Host 'copying binary'; \
	Copy-Item nats-server-v*/nats-server.exe -Destination C:\\nats-server.exe; \
	\
	Write-Host 'cleaning up'; \
	Remove-Item -Force nats.zip; \
	Remove-Item -Recurse -Force nats-server-v*; \
	\
	Write-Host 'complete.';

COPY nats-server.conf C:\\nats-server.conf

EXPOSE 4222 8222 6222
ENTRYPOINT ["C:\\nats-server.exe"]
CMD ["--config", "nats-server.conf"]


================================================
FILE: 2.10.x/windowsservercore-ltsc2022/nats-server.conf
================================================
# Client port of 4222 on all interfaces
port: 4222

# HTTP monitoring port
monitor_port: 8222

# This is for clustering multiple servers together.
cluster {
  # It is recommended to set a cluster name
  name: "my_cluster"

  # Route connections to be received on any interface on port 6222
  port: 6222

  # Routes are protected, so need to use them with --routes flag
  # e.g. --routes=nats-route://ruser:T0pS3cr3t@otherdockerhost:6222
  authorization {
    user: ruser
    password: T0pS3cr3t
    timeout: 2
  }

  # Routes are actively solicited and connected to from this server.
  # This Docker image has none by default, but you can pass a
  # flag to the nats-server docker image to create one to an existing server.
  routes = []
}


================================================
FILE: 2.10.x/windowsservercore-ltsc2025/Dockerfile
================================================
FROM mcr.microsoft.com/windows/servercore:ltsc2025

# Enable exit on error.
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop';"]

ENV NATS_DOCKERIZED 1
ENV NATS_SERVER 2.10.29
ENV NATS_SERVER_DOWNLOAD https://github.com/nats-io/nats-server/releases/download/v${NATS_SERVER}/nats-server-v${NATS_SERVER}-windows-amd64.zip
ENV NATS_SERVER_SHASUM 98657bf4d5a9ce44168c019ba6894cda8e22e6adc8798edc05c168db7262de29

RUN Set-PSDebug -Trace 2

RUN Write-Host ('downloading from {0} ...' -f $env:NATS_SERVER_DOWNLOAD); \
    [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \
    Invoke-WebRequest -Uri $env:NATS_SERVER_DOWNLOAD -OutFile nats.zip; \
    \
    Write-Host ('verifying sha256 ({0}) ...' -f $env:NATS_SERVER_SHASUM); \
    if ((Get-FileHash nats.zip -Algorithm sha256).Hash -ne $env:NATS_SERVER_SHASUM) { \
    Write-Host 'FAILED!'; \
    exit 1; \
    }; \
    Write-Host 'extracting nats.zip'; \
    Expand-Archive -Path 'nats.zip' -DestinationPath .; \
    \
    Write-Host 'copying binary'; \
    Copy-Item nats-server-v*/nats-server.exe -Destination C:\\nats-server.exe; \
    \
    Write-Host 'cleaning up'; \
    Remove-Item -Force nats.zip; \
    Remove-Item -Recurse -Force nats-server-v*; \
    \
    Write-Host 'complete.';

COPY nats-server.conf C:\\nats-server.conf

EXPOSE 4222 8222 6222
ENTRYPOINT ["C:\\nats-server.exe"]
CMD ["--config", "nats-server.conf"]


================================================
FILE: 2.10.x/windowsservercore-ltsc2025/nats-server.conf
================================================
# Client port of 4222 on all interfaces
port: 4222

# HTTP monitoring port
monitor_port: 8222

# This is for clustering multiple servers together.
cluster {
  # It is recommended to set a cluster name
  name: "my_cluster"

  # Route connections to be received on any interface on port 6222
  port: 6222

  # Routes are protected, so need to use them with --routes flag
  # e.g. --routes=nats-route://ruser:T0pS3cr3t@otherdockerhost:6222
  authorization {
    user: ruser
    password: T0pS3cr3t
    timeout: 2
  }

  # Routes are actively solicited and connected to from this server.
  # This Docker image has none by default, but you can pass a
  # flag to the nats-server docker image to create one to an existing server.
  routes = []
}


================================================
FILE: 2.11.x/alpine3.22/Dockerfile
================================================
FROM alpine:3.22

ENV NATS_SERVER 2.11.17

LABEL org.opencontainers.image.title="NATS Server" \
      org.opencontainers.image.description="NATS is an open-source, high-performance, cloud native messaging system." \
      org.opencontainers.image.url="https://nats.io" \
      org.opencontainers.image.documentation="https://docs.nats.io" \
      org.opencontainers.image.source="https://github.com/nats-io/nats-docker" \
      org.opencontainers.image.vendor="NATS.io" \
      org.opencontainers.image.licenses="Apache-2.0" \
      org.opencontainers.image.version="${NATS_SERVER}"

RUN set -eux; \
    apkArch="$(apk --print-arch)"; \
    case "$apkArch" in \
    aarch64) natsArch='arm64'; sha256='d21df24f262f34f8bf6d1f0bca557c08429e433fd9f60f6983105539ae517feb' ;; \
    armhf) natsArch='arm6'; sha256='13e090f2f433d31f1408543ef52204108eb1fcee4ac74b839a3f2f0b72aceade' ;; \
    armv7) natsArch='arm7'; sha256='5c1f445095ea9a455d6dd092967d20dd38c6bc8c4da13d108e7d3a1386ca3c7d' ;; \
    x86_64) natsArch='amd64'; sha256='ad608dd0ea8bbfa58c40e3b8f58ed67478eec26166ec49c502db8d17589b51b5' ;; \
    x86) natsArch='386'; sha256='6bfe7637dd61b9386074294c37c0790061feb39fd5198c34f9d1882c94926d5d' ;; \
    s390x) natsArch='s390x'; sha256='4e19f27f2ee5f2fe9a5480d6b4541b63f58934524c14b839b2d4d32459ca91bc' ;; \
    ppc64le) natsArch='ppc64le'; sha256='822e7a6ab51dca0cda69a3dc274ecf058f4502265984d09d9b45ab13b749a4f3' ;; \
    loong64) natsArch='loong64'; sha256='c410deb61bcad2e39739e4cc4d2a7d8cd84bb17d655d4a1e97a92c98cd309e6f' ;; \
    *) echo >&2 "error: $apkArch is not supported!"; exit 1 ;; \
    esac; \
    \
    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"; \
    echo "${sha256} *nats-server.tar.gz" | sha256sum -c -; \
    \
    apk add --no-cache ca-certificates tzdata; \
    \
    tar -xf nats-server.tar.gz; \
    rm nats-server.tar.gz; \
    mv "nats-server-v${NATS_SERVER}-linux-${natsArch}/nats-server" /usr/local/bin; \
    rm -rf "nats-server-v${NATS_SERVER}-linux-${natsArch}";

COPY nats-server.conf /etc/nats/nats-server.conf
COPY docker-entrypoint.sh /usr/local/bin

EXPOSE 4222 8222 6222
ENTRYPOINT ["docker-entrypoint.sh"]
CMD ["nats-server", "--config", "/etc/nats/nats-server.conf"]


================================================
FILE: 2.11.x/alpine3.22/docker-entrypoint.sh
================================================
#!/bin/sh
set -e

# this if will check if the first argument is a flag
# but only works if all arguments require a hyphenated flag
# -v; -SL; -f arg; etc will work, but not arg1 arg2
if [ "$#" -eq 0 ] || [ "${1#-}" != "$1" ]; then
    set -- nats-server "$@"
fi

# else default to run whatever the user wanted like "bash" or "sh"
exec "$@"



================================================
FILE: 2.11.x/alpine3.22/nats-server.conf
================================================
# Client port of 4222 on all interfaces
port: 4222

# HTTP monitoring port
monitor_port: 8222

# This is for clustering multiple servers together.
cluster {
  # It is recommended to set a cluster name
  name: "my_cluster"

  # Route connections to be received on any interface on port 6222
  port: 6222

  # Routes are protected, so need to use them with --routes flag
  # e.g. --routes=nats-route://ruser:T0pS3cr3t@otherdockerhost:6222
  authorization {
    user: ruser
    password: T0pS3cr3t
    timeout: 2
  }

  # Routes are actively solicited and connected to from this server.
  # This Docker image has none by default, but you can pass a
  # flag to the nats-server docker image to create one to an existing server.
  routes = []
}


================================================
FILE: 2.11.x/nanoserver-ltsc2022/Dockerfile
================================================
FROM mcr.microsoft.com/windows/nanoserver:ltsc2022
ENV NATS_DOCKERIZED 1

COPY --from=nats:2.11.17-windowsservercore-ltsc2022 C:\\nats-server.exe C:\\nats-server.exe
COPY nats-server.conf C:\\nats-server.conf

EXPOSE 4222 8222 6222
ENTRYPOINT ["C:\\nats-server.exe"]
CMD ["--config", "nats-server.conf"]


================================================
FILE: 2.11.x/nanoserver-ltsc2022/Dockerfile.preview
================================================
ARG BASE_IMAGE=nats:2.11.17-windowsservercore-ltsc2022
FROM $BASE_IMAGE AS base

FROM mcr.microsoft.com/windows/nanoserver:ltsc2022
ENV NATS_DOCKERIZED 1

COPY --from=base C:\\nats-server.exe C:\\nats-server.exe
COPY nats-server.conf C:\\nats-server.conf

EXPOSE 4222 8222 6222
ENTRYPOINT ["C:\\nats-server.exe"]
CMD ["--config", "nats-server.conf"]


================================================
FILE: 2.11.x/nanoserver-ltsc2022/nats-server.conf
================================================
# Client port of 4222 on all interfaces
port: 4222

# HTTP monitoring port
monitor_port: 8222

# This is for clustering multiple servers together.
cluster {
  # It is recommended to set a cluster name
  name: "my_cluster"

  # Route connections to be received on any interface on port 6222
  port: 6222

  # Routes are protected, so need to use them with --routes flag
  # e.g. --routes=nats-route://ruser:T0pS3cr3t@otherdockerhost:6222
  authorization {
    user: ruser
    password: T0pS3cr3t
    timeout: 2
  }

  # Routes are actively solicited and connected to from this server.
  # This Docker image has none by default, but you can pass a
  # flag to the nats-server docker image to create one to an existing server.
  routes = []
}


================================================
FILE: 2.11.x/nanoserver-ltsc2025/Dockerfile
================================================
FROM mcr.microsoft.com/windows/nanoserver:ltsc2025
ENV NATS_DOCKERIZED 1

COPY --from=nats:2.11.17-windowsservercore-ltsc2025 C:\\nats-server.exe C:\\nats-server.exe
COPY nats-server.conf C:\\nats-server.conf

EXPOSE 4222 8222 6222
ENTRYPOINT ["C:\\nats-server.exe"]
CMD ["--config", "nats-server.conf"]


================================================
FILE: 2.11.x/nanoserver-ltsc2025/Dockerfile.preview
================================================
ARG BASE_IMAGE=nats:2.11.17-windowsservercore-ltsc2025
FROM $BASE_IMAGE AS base

FROM mcr.microsoft.com/windows/nanoserver:ltsc2025
ENV NATS_DOCKERIZED 1

COPY --from=base C:\\nats-server.exe C:\\nats-server.exe
COPY nats-server.conf C:\\nats-server.conf

EXPOSE 4222 8222 6222
ENTRYPOINT ["C:\\nats-server.exe"]
CMD ["--config", "nats-server.conf"]


================================================
FILE: 2.11.x/nanoserver-ltsc2025/nats-server.conf
================================================
# Client port of 4222 on all interfaces
port: 4222

# HTTP monitoring port
monitor_port: 8222

# This is for clustering multiple servers together.
cluster {
  # It is recommended to set a cluster name
  name: "my_cluster"

  # Route connections to be received on any interface on port 6222
  port: 6222

  # Routes are protected, so need to use them with --routes flag
  # e.g. --routes=nats-route://ruser:T0pS3cr3t@otherdockerhost:6222
  authorization {
    user: ruser
    password: T0pS3cr3t
    timeout: 2
  }

  # Routes are actively solicited and connected to from this server.
  # This Docker image has none by default, but you can pass a
  # flag to the nats-server docker image to create one to an existing server.
  routes = []
}


================================================
FILE: 2.11.x/scratch/Dockerfile
================================================
FROM scratch
ENV PATH="$PATH:/"

COPY --from=nats:2.11.17-alpine3.22 /usr/local/bin/nats-server /nats-server
COPY nats-server.conf /nats-server.conf

EXPOSE 4222 8222 6222
ENTRYPOINT ["/nats-server"]
CMD ["--config", "nats-server.conf"]


================================================
FILE: 2.11.x/scratch/Dockerfile.preview
================================================
ARG BASE_IMAGE=nats:2.11.17-alpine3.22
FROM $BASE_IMAGE AS base

FROM scratch
ENV PATH="$PATH:/"

COPY --from=base /usr/local/bin/nats-server /nats-server
COPY nats-server.conf /nats-server.conf

EXPOSE 4222 8222 6222
ENTRYPOINT ["/nats-server"]
CMD ["--config", "nats-server.conf"]


================================================
FILE: 2.11.x/scratch/nats-server.conf
================================================
# Client port of 4222 on all interfaces
port: 4222

# HTTP monitoring port
monitor_port: 8222

# This is for clustering multiple servers together.
cluster {
  # It is recommended to set a cluster name
  name: "my_cluster"

  # Route connections to be received on any interface on port 6222
  port: 6222

  # Routes are protected, so need to use them with --routes flag
  # e.g. --routes=nats-route://ruser:T0pS3cr3t@otherdockerhost:6222
  authorization {
    user: ruser
    password: T0pS3cr3t
    timeout: 2
  }

  # Routes are actively solicited and connected to from this server.
  # This Docker image has none by default, but you can pass a
  # flag to the nats-server docker image to create one to an existing server.
  routes = []
}


================================================
FILE: 2.11.x/tests/build-images-ltsc2022.ps1
================================================
# Show statements as they run.
Set-PSDebug -Trace 2
# Exit on error.
$ErrorActionPreference = "Stop"

$ver = 'NATS_SERVER 2.11.17'.Split(' ')[1]

Write-Output '-- host info ---'
Write-Output $PSVersionTable
Write-Output (Get-WMIObject win32_operatingsystem).name
Write-Output (Get-WMIObject win32_operatingsystem).OSArchitecture

# The windowsservercore images must be built before the nanoserver images.
cd "../windowsservercore-ltsc2022"
Write-Host "building windowsservercore-ltsc2022"
docker build --tag "nats:${ver}-windowsservercore-ltsc2022" .
if ($LASTEXITCODE -ne 0) {
    exit 1
}

cd "../nanoserver-ltsc2022"
Write-Host "building nanoserver-ltsc2022"
docker build --tag "nats:${ver}-nanoserver-ltsc2022" .
if ($LASTEXITCODE -ne 0) {
    exit 1
}

docker images


================================================
FILE: 2.11.x/tests/build-images-ltsc2025.ps1
================================================
# Show statements as they run.
Set-PSDebug -Trace 2
# Exit on error.
$ErrorActionPreference = "Stop"

$ver = 'NATS_SERVER 2.11.17'.Split(' ')[1]

Write-Output '-- host info ---'
Write-Output $PSVersionTable
Write-Output (Get-WMIObject win32_operatingsystem).name
Write-Output (Get-WMIObject win32_operatingsystem).OSArchitecture

# The windowsservercore images must be built before the nanoserver images.
cd "../windowsservercore-ltsc2025"
Write-Host "building windowsservercore-ltsc2025"
docker build --tag "nats:${ver}-windowsservercore-ltsc2025" .
if ($LASTEXITCODE -ne 0) {
    exit 1
}

cd "../nanoserver-ltsc2025"
Write-Host "building nanoserver-ltsc2025"
docker build --tag "nats:${ver}-nanoserver-ltsc2025" .
if ($LASTEXITCODE -ne 0) {
    exit 1
}

docker images


================================================
FILE: 2.11.x/tests/build-images.sh
================================================
#!/usr/bin/env bash
set -ex

ver=(NATS_SERVER 2.11.17)

(
	cd "../alpine3.22"
	docker build --tag nats:${ver[1]}-alpine3.22 .
)

(
	cd "../scratch"
	docker build --tag nats:${ver[1]}-scratch .
)


================================================
FILE: 2.11.x/tests/run-images-ltsc2022.ps1
================================================
# Show statements as they run.
Set-PSDebug -Trace 2
# Exit on error.
$ErrorActionPreference = "Stop"

$ver = "NATS_SERVER 2.11.17".Split(" ")[1]

$images = @(
	"nats:${ver}-windowsservercore-ltsc2022",
	"nats:${ver}-nanoserver-ltsc2022"
)

foreach ($img in $images) {
	Write-Output "running ${img}"
	$runId = & docker run --detach "${img}"
	sleep 1

	Write-Output "checking ${img}"
	docker ps --filter "id=${runId}" --filter "status=running" --quiet
	if ($LASTEXITCODE -ne 0) {
		exit 1
	}
	docker kill $runId
}


================================================
FILE: 2.11.x/tests/run-images-ltsc2025.ps1
================================================
# Show statements as they run.
Set-PSDebug -Trace 2
# Exit on error.
$ErrorActionPreference = "Stop"

$ver = "NATS_SERVER 2.11.17".Split(" ")[1]

$images = @(
	"nats:${ver}-windowsservercore-ltsc2025",
	"nats:${ver}-nanoserver-ltsc2025"
)

foreach ($img in $images) {
	Write-Output "running ${img}"
	$runId = & docker run --detach "${img}"
	sleep 1

	Write-Output "checking ${img}"
	docker logs "$runId"
	docker ps --filter "id=${runId}" --filter "status=running" --quiet
	if ($LASTEXITCODE -ne 0) {
		exit 1
	}
	docker kill $runId
}


================================================
FILE: 2.11.x/tests/run-images.sh
================================================
#!/usr/bin/env bash
set -ex

ver=(NATS_SERVER 2.11.17)

images=(
	"nats:${ver[1]}-alpine3.22"
	"nats:${ver[1]}-scratch"
)

for img in "${images[@]}"; do
	run_id=$(docker run --detach "${img}")
	sleep 1
	test -n "$(docker ps --filter "id=${run_id}" --filter "status=running" --quiet)"
	docker kill "$run_id"
done


================================================
FILE: 2.11.x/windowsservercore-ltsc2022/Dockerfile
================================================
FROM mcr.microsoft.com/windows/servercore:ltsc2022

# Enable exit on error.
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop';"]

ENV NATS_DOCKERIZED 1
ENV NATS_SERVER 2.11.17

LABEL org.opencontainers.image.title="NATS Server" \
      org.opencontainers.image.description="NATS is an open-source, high-performance, cloud native messaging system." \
      org.opencontainers.image.url="https://nats.io" \
      org.opencontainers.image.documentation="https://docs.nats.io" \
      org.opencontainers.image.source="https://github.com/nats-io/nats-docker" \
      org.opencontainers.image.vendor="NATS.io" \
      org.opencontainers.image.licenses="Apache-2.0" \
      org.opencontainers.image.version="${NATS_SERVER}"

ENV NATS_SERVER_DOWNLOAD https://github.com/nats-io/nats-server/releases/download/v${NATS_SERVER}/nats-server-v${NATS_SERVER}-windows-amd64.zip
ENV NATS_SERVER_SHASUM 45c6a61420c87afaa31edf89372b3cfb4335ac12838fc8c593967a4d8b503f5a

RUN Set-PSDebug -Trace 2

RUN Write-Host ('downloading from {0} ...' -f $env:NATS_SERVER_DOWNLOAD); \
	[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \
	Invoke-WebRequest -Uri $env:NATS_SERVER_DOWNLOAD -OutFile nats.zip; \
	\
	Write-Host ('verifying sha256 ({0}) ...' -f $env:NATS_SERVER_SHASUM); \
	if ((Get-FileHash nats.zip -Algorithm sha256).Hash -ne $env:NATS_SERVER_SHASUM) { \
		Write-Host 'FAILED!'; \
		exit 1; \
	}; \
	Write-Host 'extracting nats.zip'; \
	Expand-Archive -Path 'nats.zip' -DestinationPath .; \
	\
	Write-Host 'copying binary'; \
	Copy-Item nats-server-v*/nats-server.exe -Destination C:\\nats-server.exe; \
	\
	Write-Host 'cleaning up'; \
	Remove-Item -Force nats.zip; \
	Remove-Item -Recurse -Force nats-server-v*; \
	\
	Write-Host 'complete.';

COPY nats-server.conf C:\\nats-server.conf

EXPOSE 4222 8222 6222
ENTRYPOINT ["C:\\nats-server.exe"]
CMD ["--config", "nats-server.conf"]


================================================
FILE: 2.11.x/windowsservercore-ltsc2022/nats-server.conf
================================================
# Client port of 4222 on all interfaces
port: 4222

# HTTP monitoring port
monitor_port: 8222

# This is for clustering multiple servers together.
cluster {
  # It is recommended to set a cluster name
  name: "my_cluster"

  # Route connections to be received on any interface on port 6222
  port: 6222

  # Routes are protected, so need to use them with --routes flag
  # e.g. --routes=nats-route://ruser:T0pS3cr3t@otherdockerhost:6222
  authorization {
    user: ruser
    password: T0pS3cr3t
    timeout: 2
  }

  # Routes are actively solicited and connected to from this server.
  # This Docker image has none by default, but you can pass a
  # flag to the nats-server docker image to create one to an existing server.
  routes = []
}


================================================
FILE: 2.11.x/windowsservercore-ltsc2025/Dockerfile
================================================
FROM mcr.microsoft.com/windows/servercore:ltsc2025

# Enable exit on error.
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop';"]

ENV NATS_DOCKERIZED 1
ENV NATS_SERVER 2.11.17

LABEL org.opencontainers.image.title="NATS Server" \
      org.opencontainers.image.description="NATS is an open-source, high-performance, cloud native messaging system." \
      org.opencontainers.image.url="https://nats.io" \
      org.opencontainers.image.documentation="https://docs.nats.io" \
      org.opencontainers.image.source="https://github.com/nats-io/nats-docker" \
      org.opencontainers.image.vendor="NATS.io" \
      org.opencontainers.image.licenses="Apache-2.0" \
      org.opencontainers.image.version="${NATS_SERVER}"

ENV NATS_SERVER_DOWNLOAD https://github.com/nats-io/nats-server/releases/download/v${NATS_SERVER}/nats-server-v${NATS_SERVER}-windows-amd64.zip
ENV NATS_SERVER_SHASUM 45c6a61420c87afaa31edf89372b3cfb4335ac12838fc8c593967a4d8b503f5a

RUN Set-PSDebug -Trace 2

RUN Write-Host ('downloading from {0} ...' -f $env:NATS_SERVER_DOWNLOAD); \
    [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \
    Invoke-WebRequest -Uri $env:NATS_SERVER_DOWNLOAD -OutFile nats.zip; \
    \
    Write-Host ('verifying sha256 ({0}) ...' -f $env:NATS_SERVER_SHASUM); \
    if ((Get-FileHash nats.zip -Algorithm sha256).Hash -ne $env:NATS_SERVER_SHASUM) { \
    Write-Host 'FAILED!'; \
    exit 1; \
    }; \
    Write-Host 'extracting nats.zip'; \
    Expand-Archive -Path 'nats.zip' -DestinationPath .; \
    \
    Write-Host 'copying binary'; \
    Copy-Item nats-server-v*/nats-server.exe -Destination C:\\nats-server.exe; \
    \
    Write-Host 'cleaning up'; \
    Remove-Item -Force nats.zip; \
    Remove-Item -Recurse -Force nats-server-v*; \
    \
    Write-Host 'complete.';

COPY nats-server.conf C:\\nats-server.conf

EXPOSE 4222 8222 6222
ENTRYPOINT ["C:\\nats-server.exe"]
CMD ["--config", "nats-server.conf"]


================================================
FILE: 2.11.x/windowsservercore-ltsc2025/nats-server.conf
================================================
# Client port of 4222 on all interfaces
port: 4222

# HTTP monitoring port
monitor_port: 8222

# This is for clustering multiple servers together.
cluster {
  # It is recommended to set a cluster name
  name: "my_cluster"

  # Route connections to be received on any interface on port 6222
  port: 6222

  # Routes are protected, so need to use them with --routes flag
  # e.g. --routes=nats-route://ruser:T0pS3cr3t@otherdockerhost:6222
  authorization {
    user: ruser
    password: T0pS3cr3t
    timeout: 2
  }

  # Routes are actively solicited and connected to from this server.
  # This Docker image has none by default, but you can pass a
  # flag to the nats-server docker image to create one to an existing server.
  routes = []
}


================================================
FILE: 2.12.x/alpine3.22/Dockerfile
================================================
FROM alpine:3.22

ENV NATS_SERVER 2.12.9-RC.1

LABEL org.opencontainers.image.title="NATS Server" \
      org.opencontainers.image.description="NATS is an open-source, high-performance, cloud native messaging system." \
      org.opencontainers.image.url="https://nats.io" \
      org.opencontainers.image.documentation="https://docs.nats.io" \
      org.opencontainers.image.source="https://github.com/nats-io/nats-docker" \
      org.opencontainers.image.vendor="NATS.io" \
      org.opencontainers.image.licenses="Apache-2.0" \
      org.opencontainers.image.version="${NATS_SERVER}"

RUN set -eux; \
    apkArch="$(apk --print-arch)"; \
    case "$apkArch" in \
    aarch64) natsArch='arm64'; sha256='1172615d086fc0b2ebb599fe9ef6211aaffaa77cd8c0c7c3fd644dc5df9d4a77' ;; \
    armhf) natsArch='arm6'; sha256='64b1b6db4ad8ee7070bd6cc7e445c1b020aee8430ce5330363ecbda44e280425' ;; \
    armv7) natsArch='arm7'; sha256='ef1de4e9e1953718cead68f27ed2d79c118578753c8d47a6cd2c8c81aa2b098b' ;; \
    x86_64) natsArch='amd64'; sha256='8ab4859b8207c39cc74563b53290ab308550e427fd613845c6d581145499123e' ;; \
    x86) natsArch='386'; sha256='538931564839a839498f952ed9e8729fcc95591dc23509348418dd4ea4b65491' ;; \
    s390x) natsArch='s390x'; sha256='f49f9cb403e9c47cc084878d10b6bacedf4f5ce671642d44c44886a14fd364fe' ;; \
    ppc64le) natsArch='ppc64le'; sha256='404a60be0a538cebc055bad6b092f2690cecdca5eb7369a67bc9eba31663787e' ;; \
    loong64) natsArch='loong64'; sha256='7dcfee3f32ab812afa82fc87cb24471a737e9e13939b1040162eff111ac289b7' ;; \
    *) echo >&2 "error: $apkArch is not supported!"; exit 1 ;; \
    esac; \
    \
    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"; \
    echo "${sha256} *nats-server.tar.gz" | sha256sum -c -; \
    \
    apk add --no-cache ca-certificates tzdata; \
    \
    tar -xf nats-server.tar.gz; \
    rm nats-server.tar.gz; \
    mv "nats-server-v${NATS_SERVER}-linux-${natsArch}/nats-server" /usr/local/bin; \
    rm -rf "nats-server-v${NATS_SERVER}-linux-${natsArch}";

COPY nats-server.conf /etc/nats/nats-server.conf
COPY docker-entrypoint.sh /usr/local/bin

EXPOSE 4222 8222 6222
ENTRYPOINT ["docker-entrypoint.sh"]
CMD ["nats-server", "--config", "/etc/nats/nats-server.conf"]


================================================
FILE: 2.12.x/alpine3.22/docker-entrypoint.sh
================================================
#!/bin/sh
set -e

# this if will check if the first argument is a flag
# but only works if all arguments require a hyphenated flag
# -v; -SL; -f arg; etc will work, but not arg1 arg2
if [ "$#" -eq 0 ] || [ "${1#-}" != "$1" ]; then
    set -- nats-server "$@"
fi

# else default to run whatever the user wanted like "bash" or "sh"
exec "$@"



================================================
FILE: 2.12.x/alpine3.22/nats-server.conf
================================================
# Client port of 4222 on all interfaces
port: 4222

# HTTP monitoring port
monitor_port: 8222

# This is for clustering multiple servers together.
cluster {
  # It is recommended to set a cluster name
  name: "my_cluster"

  # Route connections to be received on any interface on port 6222
  port: 6222

  # Routes are protected, so need to use them with --routes flag
  # e.g. --routes=nats-route://ruser:T0pS3cr3t@otherdockerhost:6222
  authorization {
    user: ruser
    password: T0pS3cr3t
    timeout: 2
  }

  # Routes are actively solicited and connected to from this server.
  # This Docker image has none by default, but you can pass a
  # flag to the nats-server docker image to create one to an existing server.
  routes = []
}


================================================
FILE: 2.12.x/nanoserver-ltsc2022/Dockerfile
================================================
FROM mcr.microsoft.com/windows/nanoserver:ltsc2022
ENV NATS_DOCKERIZED 1

COPY --from=nats:2.12.9-RC.1-windowsservercore-ltsc2022 C:\\nats-server.exe C:\\nats-server.exe
COPY nats-server.conf C:\\nats-server.conf

EXPOSE 4222 8222 6222
ENTRYPOINT ["C:\\nats-server.exe"]
CMD ["--config", "nats-server.conf"]


================================================
FILE: 2.12.x/nanoserver-ltsc2022/Dockerfile.preview
================================================
ARG BASE_IMAGE=nats:2.12.9-RC.1-windowsservercore-ltsc2022
FROM $BASE_IMAGE AS base

FROM mcr.microsoft.com/windows/nanoserver:ltsc2022
ENV NATS_DOCKERIZED 1

COPY --from=base C:\\nats-server.exe C:\\nats-server.exe
COPY nats-server.conf C:\\nats-server.conf

EXPOSE 4222 8222 6222
ENTRYPOINT ["C:\\nats-server.exe"]
CMD ["--config", "nats-server.conf"]


================================================
FILE: 2.12.x/nanoserver-ltsc2022/nats-server.conf
================================================
# Client port of 4222 on all interfaces
port: 4222

# HTTP monitoring port
monitor_port: 8222

# This is for clustering multiple servers together.
cluster {
  # It is recommended to set a cluster name
  name: "my_cluster"

  # Route connections to be received on any interface on port 6222
  port: 6222

  # Routes are protected, so need to use them with --routes flag
  # e.g. --routes=nats-route://ruser:T0pS3cr3t@otherdockerhost:6222
  authorization {
    user: ruser
    password: T0pS3cr3t
    timeout: 2
  }

  # Routes are actively solicited and connected to from this server.
  # This Docker image has none by default, but you can pass a
  # flag to the nats-server docker image to create one to an existing server.
  routes = []
}


================================================
FILE: 2.12.x/nanoserver-ltsc2025/Dockerfile
================================================
FROM mcr.microsoft.com/windows/nanoserver:ltsc2025
ENV NATS_DOCKERIZED 1

COPY --from=nats:2.12.9-RC.1-windowsservercore-ltsc2025 C:\\nats-server.exe C:\\nats-server.exe
COPY nats-server.conf C:\\nats-server.conf

EXPOSE 4222 8222 6222
ENTRYPOINT ["C:\\nats-server.exe"]
CMD ["--config", "nats-server.conf"]


================================================
FILE: 2.12.x/nanoserver-ltsc2025/Dockerfile.preview
================================================
ARG BASE_IMAGE=nats:2.12.9-RC.1-windowsservercore-ltsc2025
FROM $BASE_IMAGE AS base

FROM mcr.microsoft.com/windows/nanoserver:ltsc2025
ENV NATS_DOCKERIZED 1

COPY --from=base C:\\nats-server.exe C:\\nats-server.exe
COPY nats-server.conf C:\\nats-server.conf

EXPOSE 4222 8222 6222
ENTRYPOINT ["C:\\nats-server.exe"]
CMD ["--config", "nats-server.conf"]


================================================
FILE: 2.12.x/nanoserver-ltsc2025/nats-server.conf
================================================
# Client port of 4222 on all interfaces
port: 4222

# HTTP monitoring port
monitor_port: 8222

# This is for clustering multiple servers together.
cluster {
  # It is recommended to set a cluster name
  name: "my_cluster"

  # Route connections to be received on any interface on port 6222
  port: 6222

  # Routes are protected, so need to use them with --routes flag
  # e.g. --routes=nats-route://ruser:T0pS3cr3t@otherdockerhost:6222
  authorization {
    user: ruser
    password: T0pS3cr3t
    timeout: 2
  }

  # Routes are actively solicited and connected to from this server.
  # This Docker image has none by default, but you can pass a
  # flag to the nats-server docker image to create one to an existing server.
  routes = []
}


================================================
FILE: 2.12.x/scratch/Dockerfile
================================================
FROM scratch
ENV PATH="$PATH:/"

COPY --from=nats:2.12.9-RC.1-alpine3.22 /usr/local/bin/nats-server /nats-server
COPY nats-server.conf /nats-server.conf

EXPOSE 4222 8222 6222
ENTRYPOINT ["/nats-server"]
CMD ["--config", "nats-server.conf"]


================================================
FILE: 2.12.x/scratch/Dockerfile.preview
================================================
ARG BASE_IMAGE=nats:2.12.9-RC.1-alpine3.22
FROM $BASE_IMAGE AS base

FROM scratch
ENV PATH="$PATH:/"

COPY --from=base /usr/local/bin/nats-server /nats-server
COPY nats-server.conf /nats-server.conf

EXPOSE 4222 8222 6222
ENTRYPOINT ["/nats-server"]
CMD ["--config", "nats-server.conf"]


================================================
FILE: 2.12.x/scratch/nats-server.conf
================================================
# Client port of 4222 on all interfaces
port: 4222

# HTTP monitoring port
monitor_port: 8222

# This is for clustering multiple servers together.
cluster {
  # It is recommended to set a cluster name
  name: "my_cluster"

  # Route connections to be received on any interface on port 6222
  port: 6222

  # Routes are protected, so need to use them with --routes flag
  # e.g. --routes=nats-route://ruser:T0pS3cr3t@otherdockerhost:6222
  authorization {
    user: ruser
    password: T0pS3cr3t
    timeout: 2
  }

  # Routes are actively solicited and connected to from this server.
  # This Docker image has none by default, but you can pass a
  # flag to the nats-server docker image to create one to an existing server.
  routes = []
}


================================================
FILE: 2.12.x/tests/build-images-ltsc2022.ps1
================================================
# Show statements as they run.
Set-PSDebug -Trace 2
# Exit on error.
$ErrorActionPreference = "Stop"

$ver = 'NATS_SERVER 2.12.9-RC.1'.Split(' ')[1]

Write-Output '-- host info ---'
Write-Output $PSVersionTable
Write-Output (Get-WMIObject win32_operatingsystem).name
Write-Output (Get-WMIObject win32_operatingsystem).OSArchitecture

# The windowsservercore images must be built before the nanoserver images.
cd "../windowsservercore-ltsc2022"
Write-Host "building windowsservercore-ltsc2022"
docker build --tag "nats:${ver}-windowsservercore-ltsc2022" .
if ($LASTEXITCODE -ne 0) {
    exit 1
}

cd "../nanoserver-ltsc2022"
Write-Host "building nanoserver-ltsc2022"
docker build --tag "nats:${ver}-nanoserver-ltsc2022" .
if ($LASTEXITCODE -ne 0) {
    exit 1
}

docker images


================================================
FILE: 2.12.x/tests/build-images-ltsc2025.ps1
================================================
# Show statements as they run.
Set-PSDebug -Trace 2
# Exit on error.
$ErrorActionPreference = "Stop"

$ver = 'NATS_SERVER 2.12.9-RC.1'.Split(' ')[1]

Write-Output '-- host info ---'
Write-Output $PSVersionTable
Write-Output (Get-WMIObject win32_operatingsystem).name
Write-Output (Get-WMIObject win32_operatingsystem).OSArchitecture

# The windowsservercore images must be built before the nanoserver images.
cd "../windowsservercore-ltsc2025"
Write-Host "building windowsservercore-ltsc2025"
docker build --tag "nats:${ver}-windowsservercore-ltsc2025" .
if ($LASTEXITCODE -ne 0) {
    exit 1
}

cd "../nanoserver-ltsc2025"
Write-Host "building nanoserver-ltsc2025"
docker build --tag "nats:${ver}-nanoserver-ltsc2025" .
if ($LASTEXITCODE -ne 0) {
    exit 1
}

docker images


================================================
FILE: 2.12.x/tests/build-images.sh
================================================
#!/usr/bin/env bash
set -ex

ver=(NATS_SERVER 2.12.9-RC.1)

(
	cd "../alpine3.22"
	docker build --tag nats:${ver[1]}-alpine3.22 .
)

(
	cd "../scratch"
	docker build --tag nats:${ver[1]}-scratch .
)


================================================
FILE: 2.12.x/tests/run-images-ltsc2022.ps1
================================================
# Show statements as they run.
Set-PSDebug -Trace 2
# Exit on error.
$ErrorActionPreference = "Stop"

$ver = "NATS_SERVER 2.12.9-RC.1".Split(" ")[1]

$images = @(
	"nats:${ver}-windowsservercore-ltsc2022",
	"nats:${ver}-nanoserver-ltsc2022"
)

foreach ($img in $images) {
	Write-Output "running ${img}"
	$runId = & docker run --detach "${img}"
	sleep 1

	Write-Output "checking ${img}"
	docker ps --filter "id=${runId}" --filter "status=running" --quiet
	if ($LASTEXITCODE -ne 0) {
		exit 1
	}
	docker kill $runId
}


================================================
FILE: 2.12.x/tests/run-images-ltsc2025.ps1
================================================
# Show statements as they run.
Set-PSDebug -Trace 2
# Exit on error.
$ErrorActionPreference = "Stop"

$ver = "NATS_SERVER 2.12.9-RC.1".Split(" ")[1]

$images = @(
	"nats:${ver}-windowsservercore-ltsc2025",
	"nats:${ver}-nanoserver-ltsc2025"
)

foreach ($img in $images) {
	Write-Output "running ${img}"
	$runId = & docker run --detach "${img}"
	sleep 1

	Write-Output "checking ${img}"
	docker logs "$runId"
	docker ps --filter "id=${runId}" --filter "status=running" --quiet
	if ($LASTEXITCODE -ne 0) {
		exit 1
	}
	docker kill $runId
}


================================================
FILE: 2.12.x/tests/run-images.sh
================================================
#!/usr/bin/env bash
set -ex

ver=(NATS_SERVER 2.12.9-RC.1)

images=(
	"nats:${ver[1]}-alpine3.22"
	"nats:${ver[1]}-scratch"
)

for img in "${images[@]}"; do
	run_id=$(docker run --detach "${img}")
	sleep 1
	test -n "$(docker ps --filter "id=${run_id}" --filter "status=running" --quiet)"
	docker kill "$run_id"
done


================================================
FILE: 2.12.x/windowsservercore-ltsc2022/Dockerfile
================================================
FROM mcr.microsoft.com/windows/servercore:ltsc2022

# Enable exit on error.
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop';"]

ENV NATS_DOCKERIZED 1
ENV NATS_SERVER 2.12.9-RC.1

LABEL org.opencontainers.image.title="NATS Server" \
      org.opencontainers.image.description="NATS is an open-source, high-performance, cloud native messaging system." \
      org.opencontainers.image.url="https://nats.io" \
      org.opencontainers.image.documentation="https://docs.nats.io" \
      org.opencontainers.image.source="https://github.com/nats-io/nats-docker" \
      org.opencontainers.image.vendor="NATS.io" \
      org.opencontainers.image.licenses="Apache-2.0" \
      org.opencontainers.image.version="${NATS_SERVER}"

ENV NATS_SERVER_DOWNLOAD https://github.com/nats-io/nats-server/releases/download/v${NATS_SERVER}/nats-server-v${NATS_SERVER}-windows-amd64.zip
ENV NATS_SERVER_SHASUM f4119594bda99347006167fb1d6c07cab5ab9c734d87744996bcc5db609ffbec

RUN Set-PSDebug -Trace 2

RUN Write-Host ('downloading from {0} ...' -f $env:NATS_SERVER_DOWNLOAD); \
	[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \
	Invoke-WebRequest -Uri $env:NATS_SERVER_DOWNLOAD -OutFile nats.zip; \
	\
	Write-Host ('verifying sha256 ({0}) ...' -f $env:NATS_SERVER_SHASUM); \
	if ((Get-FileHash nats.zip -Algorithm sha256).Hash -ne $env:NATS_SERVER_SHASUM) { \
		Write-Host 'FAILED!'; \
		exit 1; \
	}; \
	Write-Host 'extracting nats.zip'; \
	Expand-Archive -Path 'nats.zip' -DestinationPath .; \
	\
	Write-Host 'copying binary'; \
	Copy-Item nats-server-v*/nats-server.exe -Destination C:\\nats-server.exe; \
	\
	Write-Host 'cleaning up'; \
	Remove-Item -Force nats.zip; \
	Remove-Item -Recurse -Force nats-server-v*; \
	\
	Write-Host 'complete.';

COPY nats-server.conf C:\\nats-server.conf

EXPOSE 4222 8222 6222
ENTRYPOINT ["C:\\nats-server.exe"]
CMD ["--config", "nats-server.conf"]


================================================
FILE: 2.12.x/windowsservercore-ltsc2022/nats-server.conf
================================================
# Client port of 4222 on all interfaces
port: 4222

# HTTP monitoring port
monitor_port: 8222

# This is for clustering multiple servers together.
cluster {
  # It is recommended to set a cluster name
  name: "my_cluster"

  # Route connections to be received on any interface on port 6222
  port: 6222

  # Routes are protected, so need to use them with --routes flag
  # e.g. --routes=nats-route://ruser:T0pS3cr3t@otherdockerhost:6222
  authorization {
    user: ruser
    password: T0pS3cr3t
    timeout: 2
  }

  # Routes are actively solicited and connected to from this server.
  # This Docker image has none by default, but you can pass a
  # flag to the nats-server docker image to create one to an existing server.
  routes = []
}


================================================
FILE: 2.12.x/windowsservercore-ltsc2025/Dockerfile
================================================
FROM mcr.microsoft.com/windows/servercore:ltsc2025

# Enable exit on error.
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop';"]

ENV NATS_DOCKERIZED 1
ENV NATS_SERVER 2.12.9-RC.1

LABEL org.opencontainers.image.title="NATS Server" \
      org.opencontainers.image.description="NATS is an open-source, high-performance, cloud native messaging system." \
      org.opencontainers.image.url="https://nats.io" \
      org.opencontainers.image.documentation="https://docs.nats.io" \
      org.opencontainers.image.source="https://github.com/nats-io/nats-docker" \
      org.opencontainers.image.vendor="NATS.io" \
      org.opencontainers.image.licenses="Apache-2.0" \
      org.opencontainers.image.version="${NATS_SERVER}"

ENV NATS_SERVER_DOWNLOAD https://github.com/nats-io/nats-server/releases/download/v${NATS_SERVER}/nats-server-v${NATS_SERVER}-windows-amd64.zip
ENV NATS_SERVER_SHASUM f4119594bda99347006167fb1d6c07cab5ab9c734d87744996bcc5db609ffbec

RUN Set-PSDebug -Trace 2

RUN Write-Host ('downloading from {0} ...' -f $env:NATS_SERVER_DOWNLOAD); \
    [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \
    Invoke-WebRequest -Uri $env:NATS_SERVER_DOWNLOAD -OutFile nats.zip; \
    \
    Write-Host ('verifying sha256 ({0}) ...' -f $env:NATS_SERVER_SHASUM); \
    if ((Get-FileHash nats.zip -Algorithm sha256).Hash -ne $env:NATS_SERVER_SHASUM) { \
    Write-Host 'FAILED!'; \
    exit 1; \
    }; \
    Write-Host 'extracting nats.zip'; \
    Expand-Archive -Path 'nats.zip' -DestinationPath .; \
    \
    Write-Host 'copying binary'; \
    Copy-Item nats-server-v*/nats-server.exe -Destination C:\\nats-server.exe; \
    \
    Write-Host 'cleaning up'; \
    Remove-Item -Force nats.zip; \
    Remove-Item -Recurse -Force nats-server-v*; \
    \
    Write-Host 'complete.';

COPY nats-server.conf C:\\nats-server.conf

EXPOSE 4222 8222 6222
ENTRYPOINT ["C:\\nats-server.exe"]
CMD ["--config", "nats-server.conf"]


================================================
FILE: 2.12.x/windowsservercore-ltsc2025/nats-server.conf
================================================
# Client port of 4222 on all interfaces
port: 4222

# HTTP monitoring port
monitor_port: 8222

# This is for clustering multiple servers together.
cluster {
  # It is recommended to set a cluster name
  name: "my_cluster"

  # Route connections to be received on any interface on port 6222
  port: 6222

  # Routes are protected, so need to use them with --routes flag
  # e.g. --routes=nats-route://ruser:T0pS3cr3t@otherdockerhost:6222
  authorization {
    user: ruser
    password: T0pS3cr3t
    timeout: 2
  }

  # Routes are actively solicited and connected to from this server.
  # This Docker image has none by default, but you can pass a
  # flag to the nats-server docker image to create one to an existing server.
  routes = []
}


================================================
FILE: 2.14.x/alpine3.22/Dockerfile
================================================
FROM alpine:3.22

ENV NATS_SERVER 2.14.1-RC.1

LABEL org.opencontainers.image.title="NATS Server" \
      org.opencontainers.image.description="NATS is an open-source, high-performance, cloud native messaging system." \
      org.opencontainers.image.url="https://nats.io" \
      org.opencontainers.image.documentation="https://docs.nats.io" \
      org.opencontainers.image.source="https://github.com/nats-io/nats-docker" \
      org.opencontainers.image.vendor="NATS.io" \
      org.opencontainers.image.licenses="Apache-2.0" \
      org.opencontainers.image.version="${NATS_SERVER}"

RUN set -eux; \
    apkArch="$(apk --print-arch)"; \
    case "$apkArch" in \
    aarch64) natsArch='arm64'; sha256='c48b0bbb46427075fa6d47f4b639f99f9f6b1b4adcf2ed28181379523b9b8f98' ;; \
    armhf) natsArch='arm6'; sha256='fa51ba7dc43fec0d5d24930d1f6b56c93ca88a26d1b9830424af934eef43d07e' ;; \
    armv7) natsArch='arm7'; sha256='c57b0099a6b0b89f8200e37e034756662179d08ff890f99f002e9674779c6e5f' ;; \
    x86_64) natsArch='amd64'; sha256='fdd800cf565dc5c32f122e1d1bbc34810be72675a27bbc7baf68b7067ce2a9e6' ;; \
    x86) natsArch='386'; sha256='9e66899796640f5fdea2f92e8a73c80527823b00375672dc172516a7a2662bea' ;; \
    s390x) natsArch='s390x'; sha256='7e7d734ff489950d5409250007fad504345ef57d5e765202decfb05f56433c73' ;; \
    ppc64le) natsArch='ppc64le'; sha256='9e9d77cbcdc9a1e8c43dc6839f68b898cdf5d3dc0f5d7e33a02c2373773653a4' ;; \
    loong64) natsArch='loong64'; sha256='eddf206b81ff78bd97f3e69e2eae9122b02ad864dee371f6f4db84da4a6f52b4' ;; \
    *) echo >&2 "error: $apkArch is not supported!"; exit 1 ;; \
    esac; \
    \
    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"; \
    echo "${sha256} *nats-server.tar.gz" | sha256sum -c -; \
    \
    apk add --no-cache ca-certificates tzdata; \
    \
    tar -xf nats-server.tar.gz; \
    rm nats-server.tar.gz; \
    mv "nats-server-v${NATS_SERVER}-linux-${natsArch}/nats-server" /usr/local/bin; \
    rm -rf "nats-server-v${NATS_SERVER}-linux-${natsArch}";

COPY nats-server.conf /etc/nats/nats-server.conf
COPY docker-entrypoint.sh /usr/local/bin

EXPOSE 4222 8222 6222
ENTRYPOINT ["docker-entrypoint.sh"]
CMD ["nats-server", "--config", "/etc/nats/nats-server.conf"]


================================================
FILE: 2.14.x/alpine3.22/docker-entrypoint.sh
================================================
#!/bin/sh
set -e

# this if will check if the first argument is a flag
# but only works if all arguments require a hyphenated flag
# -v; -SL; -f arg; etc will work, but not arg1 arg2
if [ "$#" -eq 0 ] || [ "${1#-}" != "$1" ]; then
    set -- nats-server "$@"
fi

# else default to run whatever the user wanted like "bash" or "sh"
exec "$@"



================================================
FILE: 2.14.x/alpine3.22/nats-server.conf
================================================
# Client port of 4222 on all interfaces
port: 4222

# HTTP monitoring port
monitor_port: 8222

# This is for clustering multiple servers together.
cluster {
  # It is recommended to set a cluster name
  name: "my_cluster"

  # Route connections to be received on any interface on port 6222
  port: 6222

  # Routes are protected, so need to use them with --routes flag
  # e.g. --routes=nats-route://ruser:T0pS3cr3t@otherdockerhost:6222
  authorization {
    user: ruser
    password: T0pS3cr3t
    timeout: 2
  }

  # Routes are actively solicited and connected to from this server.
  # This Docker image has none by default, but you can pass a
  # flag to the nats-server docker image to create one to an existing server.
  routes = []
}


================================================
FILE: 2.14.x/nanoserver-ltsc2022/Dockerfile
================================================
FROM mcr.microsoft.com/windows/nanoserver:ltsc2022
ENV NATS_DOCKERIZED 1

COPY --from=nats:2.14.1-RC.1-windowsservercore-ltsc2022 C:\\nats-server.exe C:\\nats-server.exe
COPY nats-server.conf C:\\nats-server.conf

EXPOSE 4222 8222 6222
ENTRYPOINT ["C:\\nats-server.exe"]
CMD ["--config", "nats-server.conf"]


================================================
FILE: 2.14.x/nanoserver-ltsc2022/Dockerfile.preview
================================================
ARG BASE_IMAGE=nats:2.14.1-RC.1-windowsservercore-ltsc2022
FROM $BASE_IMAGE AS base

FROM mcr.microsoft.com/windows/nanoserver:ltsc2022
ENV NATS_DOCKERIZED 1

COPY --from=base C:\\nats-server.exe C:\\nats-server.exe
COPY nats-server.conf C:\\nats-server.conf

EXPOSE 4222 8222 6222
ENTRYPOINT ["C:\\nats-server.exe"]
CMD ["--config", "nats-server.conf"]


================================================
FILE: 2.14.x/nanoserver-ltsc2022/nats-server.conf
================================================
# Client port of 4222 on all interfaces
port: 4222

# HTTP monitoring port
monitor_port: 8222

# This is for clustering multiple servers together.
cluster {
  # It is recommended to set a cluster name
  name: "my_cluster"

  # Route connections to be received on any interface on port 6222
  port: 6222

  # Routes are protected, so need to use them with --routes flag
  # e.g. --routes=nats-route://ruser:T0pS3cr3t@otherdockerhost:6222
  authorization {
    user: ruser
    password: T0pS3cr3t
    timeout: 2
  }

  # Routes are actively solicited and connected to from this server.
  # This Docker image has none by default, but you can pass a
  # flag to the nats-server docker image to create one to an existing server.
  routes = []
}


================================================
FILE: 2.14.x/nanoserver-ltsc2025/Dockerfile
================================================
FROM mcr.microsoft.com/windows/nanoserver:ltsc2025
ENV NATS_DOCKERIZED 1

COPY --from=nats:2.14.1-RC.1-windowsservercore-ltsc2025 C:\\nats-server.exe C:\\nats-server.exe
COPY nats-server.conf C:\\nats-server.conf

EXPOSE 4222 8222 6222
ENTRYPOINT ["C:\\nats-server.exe"]
CMD ["--config", "nats-server.conf"]


================================================
FILE: 2.14.x/nanoserver-ltsc2025/Dockerfile.preview
================================================
ARG BASE_IMAGE=nats:2.14.1-RC.1-windowsservercore-ltsc2025
FROM $BASE_IMAGE AS base

FROM mcr.microsoft.com/windows/nanoserver:ltsc2025
ENV NATS_DOCKERIZED 1

COPY --from=base C:\\nats-server.exe C:\\nats-server.exe
COPY nats-server.conf C:\\nats-server.conf

EXPOSE 4222 8222 6222
ENTRYPOINT ["C:\\nats-server.exe"]
CMD ["--config", "nats-server.conf"]


================================================
FILE: 2.14.x/nanoserver-ltsc2025/nats-server.conf
================================================
# Client port of 4222 on all interfaces
port: 4222

# HTTP monitoring port
monitor_port: 8222

# This is for clustering multiple servers together.
cluster {
  # It is recommended to set a cluster name
  name: "my_cluster"

  # Route connections to be received on any interface on port 6222
  port: 6222

  # Routes are protected, so need to use them with --routes flag
  # e.g. --routes=nats-route://ruser:T0pS3cr3t@otherdockerhost:6222
  authorization {
    user: ruser
    password: T0pS3cr3t
    timeout: 2
  }

  # Routes are actively solicited and connected to from this server.
  # This Docker image has none by default, but you can pass a
  # flag to the nats-server docker image to create one to an existing server.
  routes = []
}


================================================
FILE: 2.14.x/scratch/Dockerfile
================================================
FROM scratch
ENV PATH="$PATH:/"

COPY --from=nats:2.14.1-RC.1-alpine3.22 /usr/local/bin/nats-server /nats-server
COPY nats-server.conf /nats-server.conf

EXPOSE 4222 8222 6222
ENTRYPOINT ["/nats-server"]
CMD ["--config", "nats-server.conf"]


================================================
FILE: 2.14.x/scratch/Dockerfile.preview
================================================
ARG BASE_IMAGE=nats:2.14.1-RC.1-alpine3.22
FROM $BASE_IMAGE AS base

FROM scratch
ENV PATH="$PATH:/"

COPY --from=base /usr/local/bin/nats-server /nats-server
COPY nats-server.conf /nats-server.conf

EXPOSE 4222 8222 6222
ENTRYPOINT ["/nats-server"]
CMD ["--config", "nats-server.conf"]


================================================
FILE: 2.14.x/scratch/nats-server.conf
================================================
# Client port of 4222 on all interfaces
port: 4222

# HTTP monitoring port
monitor_port: 8222

# This is for clustering multiple servers together.
cluster {
  # It is recommended to set a cluster name
  name: "my_cluster"

  # Route connections to be received on any interface on port 6222
  port: 6222

  # Routes are protected, so need to use them with --routes flag
  # e.g. --routes=nats-route://ruser:T0pS3cr3t@otherdockerhost:6222
  authorization {
    user: ruser
    password: T0pS3cr3t
    timeout: 2
  }

  # Routes are actively solicited and connected to from this server.
  # This Docker image has none by default, but you can pass a
  # flag to the nats-server docker image to create one to an existing server.
  routes = []
}


================================================
FILE: 2.14.x/tests/build-images-ltsc2022.ps1
================================================
# Show statements as they run.
Set-PSDebug -Trace 2
# Exit on error.
$ErrorActionPreference = "Stop"

$ver = 'NATS_SERVER 2.14.1-RC.1'.Split(' ')[1]

Write-Output '-- host info ---'
Write-Output $PSVersionTable
Write-Output (Get-WMIObject win32_operatingsystem).name
Write-Output (Get-WMIObject win32_operatingsystem).OSArchitecture

# The windowsservercore images must be built before the nanoserver images.
cd "../windowsservercore-ltsc2022"
Write-Host "building windowsservercore-ltsc2022"
docker build --tag "nats:${ver}-windowsservercore-ltsc2022" .
if ($LASTEXITCODE -ne 0) {
    exit 1
}

cd "../nanoserver-ltsc2022"
Write-Host "building nanoserver-ltsc2022"
docker build --tag "nats:${ver}-nanoserver-ltsc2022" .
if ($LASTEXITCODE -ne 0) {
    exit 1
}

docker images


================================================
FILE: 2.14.x/tests/build-images-ltsc2025.ps1
================================================
# Show statements as they run.
Set-PSDebug -Trace 2
# Exit on error.
$ErrorActionPreference = "Stop"

$ver = 'NATS_SERVER 2.14.1-RC.1'.Split(' ')[1]

Write-Output '-- host info ---'
Write-Output $PSVersionTable
Write-Output (Get-WMIObject win32_operatingsystem).name
Write-Output (Get-WMIObject win32_operatingsystem).OSArchitecture

# The windowsservercore images must be built before the nanoserver images.
cd "../windowsservercore-ltsc2025"
Write-Host "building windowsservercore-ltsc2025"
docker build --tag "nats:${ver}-windowsservercore-ltsc2025" .
if ($LASTEXITCODE -ne 0) {
    exit 1
}

cd "../nanoserver-ltsc2025"
Write-Host "building nanoserver-ltsc2025"
docker build --tag "nats:${ver}-nanoserver-ltsc2025" .
if ($LASTEXITCODE -ne 0) {
    exit 1
}

docker images


================================================
FILE: 2.14.x/tests/build-images.sh
================================================
#!/usr/bin/env bash
set -ex

ver=(NATS_SERVER 2.14.1-RC.1)

(
	cd "../alpine3.22"
	docker build --tag nats:${ver[1]}-alpine3.22 .
)

(
	cd "../scratch"
	docker build --tag nats:${ver[1]}-scratch .
)


================================================
FILE: 2.14.x/tests/run-images-ltsc2022.ps1
================================================
# Show statements as they run.
Set-PSDebug -Trace 2
# Exit on error.
$ErrorActionPreference = "Stop"

$ver = "NATS_SERVER 2.14.1-RC.1".Split(" ")[1]

$images = @(
	"nats:${ver}-windowsservercore-ltsc2022",
	"nats:${ver}-nanoserver-ltsc2022"
)

foreach ($img in $images) {
	Write-Output "running ${img}"
	$runId = & docker run --detach "${img}"
	sleep 1

	Write-Output "checking ${img}"
	docker ps --filter "id=${runId}" --filter "status=running" --quiet
	if ($LASTEXITCODE -ne 0) {
		exit 1
	}
	docker kill $runId
}


================================================
FILE: 2.14.x/tests/run-images-ltsc2025.ps1
================================================
# Show statements as they run.
Set-PSDebug -Trace 2
# Exit on error.
$ErrorActionPreference = "Stop"

$ver = "NATS_SERVER 2.14.1-RC.1".Split(" ")[1]

$images = @(
	"nats:${ver}-windowsservercore-ltsc2025",
	"nats:${ver}-nanoserver-ltsc2025"
)

foreach ($img in $images) {
	Write-Output "running ${img}"
	$runId = & docker run --detach "${img}"
	sleep 1

	Write-Output "checking ${img}"
	docker logs "$runId"
	docker ps --filter "id=${runId}" --filter "status=running" --quiet
	if ($LASTEXITCODE -ne 0) {
		exit 1
	}
	docker kill $runId
}


================================================
FILE: 2.14.x/tests/run-images.sh
================================================
#!/usr/bin/env bash
set -ex

ver=(NATS_SERVER 2.14.1-RC.1)

images=(
	"nats:${ver[1]}-alpine3.22"
	"nats:${ver[1]}-scratch"
)

for img in "${images[@]}"; do
	run_id=$(docker run --detach "${img}")
	sleep 1
	test -n "$(docker ps --filter "id=${run_id}" --filter "status=running" --quiet)"
	docker kill "$run_id"
done


================================================
FILE: 2.14.x/windowsservercore-ltsc2022/Dockerfile
================================================
FROM mcr.microsoft.com/windows/servercore:ltsc2022

# Enable exit on error.
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop';"]

ENV NATS_DOCKERIZED 1
ENV NATS_SERVER 2.14.1-RC.1

LABEL org.opencontainers.image.title="NATS Server" \
      org.opencontainers.image.description="NATS is an open-source, high-performance, cloud native messaging system." \
      org.opencontainers.image.url="https://nats.io" \
      org.opencontainers.image.documentation="https://docs.nats.io" \
      org.opencontainers.image.source="https://github.com/nats-io/nats-docker" \
      org.opencontainers.image.vendor="NATS.io" \
      org.opencontainers.image.licenses="Apache-2.0" \
      org.opencontainers.image.version="${NATS_SERVER}"

ENV NATS_SERVER_DOWNLOAD https://github.com/nats-io/nats-server/releases/download/v${NATS_SERVER}/nats-server-v${NATS_SERVER}-windows-amd64.zip
ENV NATS_SERVER_SHASUM 3d229792d7ef436497bca067d6961a893e7c2b5d1df8da0b020220a729d12cc3

RUN Set-PSDebug -Trace 2

RUN Write-Host ('downloading from {0} ...' -f $env:NATS_SERVER_DOWNLOAD); \
	[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \
	Invoke-WebRequest -Uri $env:NATS_SERVER_DOWNLOAD -OutFile nats.zip; \
	\
	Write-Host ('verifying sha256 ({0}) ...' -f $env:NATS_SERVER_SHASUM); \
	if ((Get-FileHash nats.zip -Algorithm sha256).Hash -ne $env:NATS_SERVER_SHASUM) { \
		Write-Host 'FAILED!'; \
		exit 1; \
	}; \
	Write-Host 'extracting nats.zip'; \
	Expand-Archive -Path 'nats.zip' -DestinationPath .; \
	\
	Write-Host 'copying binary'; \
	Copy-Item nats-server-v*/nats-server.exe -Destination C:\\nats-server.exe; \
	\
	Write-Host 'cleaning up'; \
	Remove-Item -Force nats.zip; \
	Remove-Item -Recurse -Force nats-server-v*; \
	\
	Write-Host 'complete.';

COPY nats-server.conf C:\\nats-server.conf

EXPOSE 4222 8222 6222
ENTRYPOINT ["C:\\nats-server.exe"]
CMD ["--config", "nats-server.conf"]


================================================
FILE: 2.14.x/windowsservercore-ltsc2022/nats-server.conf
================================================
# Client port of 4222 on all interfaces
port: 4222

# HTTP monitoring port
monitor_port: 8222

# This is for clustering multiple servers together.
cluster {
  # It is recommended to set a cluster name
  name: "my_cluster"

  # Route connections to be received on any interface on port 6222
  port: 6222

  # Routes are protected, so need to use them with --routes flag
  # e.g. --routes=nats-route://ruser:T0pS3cr3t@otherdockerhost:6222
  authorization {
    user: ruser
    password: T0pS3cr3t
    timeout: 2
  }

  # Routes are actively solicited and connected to from this server.
  # This Docker image has none by default, but you can pass a
  # flag to the nats-server docker image to create one to an existing server.
  routes = []
}


================================================
FILE: 2.14.x/windowsservercore-ltsc2025/Dockerfile
================================================
FROM mcr.microsoft.com/windows/servercore:ltsc2025

# Enable exit on error.
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop';"]

ENV NATS_DOCKERIZED 1
ENV NATS_SERVER 2.14.1-RC.1

LABEL org.opencontainers.image.title="NATS Server" \
      org.opencontainers.image.description="NATS is an open-source, high-performance, cloud native messaging system." \
      org.opencontainers.image.url="https://nats.io" \
      org.opencontainers.image.documentation="https://docs.nats.io" \
      org.opencontainers.image.source="https://github.com/nats-io/nats-docker" \
      org.opencontainers.image.vendor="NATS.io" \
      org.opencontainers.image.licenses="Apache-2.0" \
      org.opencontainers.image.version="${NATS_SERVER}"

ENV NATS_SERVER_DOWNLOAD https://github.com/nats-io/nats-server/releases/download/v${NATS_SERVER}/nats-server-v${NATS_SERVER}-windows-amd64.zip
ENV NATS_SERVER_SHASUM 3d229792d7ef436497bca067d6961a893e7c2b5d1df8da0b020220a729d12cc3

RUN Set-PSDebug -Trace 2

RUN Write-Host ('downloading from {0} ...' -f $env:NATS_SERVER_DOWNLOAD); \
    [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \
    Invoke-WebRequest -Uri $env:NATS_SERVER_DOWNLOAD -OutFile nats.zip; \
    \
    Write-Host ('verifying sha256 ({0}) ...' -f $env:NATS_SERVER_SHASUM); \
    if ((Get-FileHash nats.zip -Algorithm sha256).Hash -ne $env:NATS_SERVER_SHASUM) { \
    Write-Host 'FAILED!'; \
    exit 1; \
    }; \
    Write-Host 'extracting nats.zip'; \
    Expand-Archive -Path 'nats.zip' -DestinationPath .; \
    \
    Write-Host 'copying binary'; \
    Copy-Item nats-server-v*/nats-server.exe -Destination C:\\nats-server.exe; \
    \
    Write-Host 'cleaning up'; \
    Remove-Item -Force nats.zip; \
    Remove-Item -Recurse -Force nats-server-v*; \
    \
    Write-Host 'complete.';

COPY nats-server.conf C:\\nats-server.conf

EXPOSE 4222 8222 6222
ENTRYPOINT ["C:\\nats-server.exe"]
CMD ["--config", "nats-server.conf"]


================================================
FILE: 2.14.x/windowsservercore-ltsc2025/nats-server.conf
================================================
# Client port of 4222 on all interfaces
port: 4222

# HTTP monitoring port
monitor_port: 8222

# This is for clustering multiple servers together.
cluster {
  # It is recommended to set a cluster name
  name: "my_cluster"

  # Route connections to be received on any interface on port 6222
  port: 6222

  # Routes are protected, so need to use them with --routes flag
  # e.g. --routes=nats-route://ruser:T0pS3cr3t@otherdockerhost:6222
  authorization {
    user: ruser
    password: T0pS3cr3t
    timeout: 2
  }

  # Routes are actively solicited and connected to from this server.
  # This Docker image has none by default, but you can pass a
  # flag to the nats-server docker image to create one to an existing server.
  routes = []
}


================================================
FILE: LICENSE
================================================
                                 Apache License
                           Version 2.0, January 2004
                        http://www.apache.org/licenses/

   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION

   1. Definitions.

      "License" shall mean the terms and conditions for use, reproduction,
      and distribution as defined by Sections 1 through 9 of this document.

      "Licensor" shall mean the copyright owner or entity authorized by
      the copyright owner that is granting the License.

      "Legal Entity" shall mean the union of the acting entity and all
      other entities that control, are controlled by, or are under common
      control with that entity. For the purposes of this definition,
      "control" means (i) the power, direct or indirect, to cause the
      direction or management of such entity, whether by contract or
      otherwise, or (ii) ownership of fifty percent (50%) or more of the
      outstanding shares, or (iii) beneficial ownership of such entity.

      "You" (or "Your") shall mean an individual or Legal Entity
      exercising permissions granted by this License.

      "Source" form shall mean the preferred form for making modifications,
      including but not limited to software source code, documentation
      source, and configuration files.

      "Object" form shall mean any form resulting from mechanical
      transformation or translation of a Source form, including but
      not limited to compiled object code, generated documentation,
      and conversions to other media types.

      "Work" shall mean the work of authorship, whether in Source or
      Object form, made available under the License, as indicated by a
      copyright notice that is included in or attached to the work
      (an example is provided in the Appendix below).

      "Derivative Works" shall mean any work, whether in Source or Object
      form, that is based on (or derived from) the Work and for which the
      editorial revisions, annotations, elaborations, or other modifications
      represent, as a whole, an original work of authorship. For the purposes
      of this License, Derivative Works shall not include works that remain
      separable from, or merely link (or bind by name) to the interfaces of,
      the Work and Derivative Works thereof.

      "Contribution" shall mean any work of authorship, including
      the original version of the Work and any modifications or additions
      to that Work or Derivative Works thereof, that is intentionally
      submitted to Licensor for inclusion in the Work by the copyright owner
      or by an individual or Legal Entity authorized to submit on behalf of
      the copyright owner. For the purposes of this definition, "submitted"
      means any form of electronic, verbal, or written communication sent
      to the Licensor or its representatives, including but not limited to
      communication on electronic mailing lists, source code control systems,
      and issue tracking systems that are managed by, or on behalf of, the
      Licensor for the purpose of discussing and improving the Work, but
      excluding communication that is conspicuously marked or otherwise
      designated in writing by the copyright owner as "Not a Contribution."

      "Contributor" shall mean Licensor and any individual or Legal Entity
      on behalf of whom a Contribution has been received by Licensor and
      subsequently incorporated within the Work.

   2. Grant of Copyright License. Subject to the terms and conditions of
      this License, each Contributor hereby grants to You a perpetual,
      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
      copyright license to reproduce, prepare Derivative Works of,
      publicly display, publicly perform, sublicense, and distribute the
      Work and such Derivative Works in Source or Object form.

   3. Grant of Patent License. Subject to the terms and conditions of
      this License, each Contributor hereby grants to You a perpetual,
      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
      (except as stated in this section) patent license to make, have made,
      use, offer to sell, sell, import, and otherwise transfer the Work,
      where such license applies only to those patent claims licensable
      by such Contributor that are necessarily infringed by their
      Contribution(s) alone or by combination of their Contribution(s)
      with the Work to which such Contribution(s) was submitted. If You
      institute patent litigation against any entity (including a
      cross-claim or counterclaim in a lawsuit) alleging that the Work
      or a Contribution incorporated within the Work constitutes direct
      or contributory patent infringement, then any patent licenses
      granted to You under this License for that Work shall terminate
      as of the date such litigation is filed.

   4. Redistribution. You may reproduce and distribute copies of the
      Work or Derivative Works thereof in any medium, with or without
      modifications, and in Source or Object form, provided that You
      meet the following conditions:

      (a) You must give any other recipients of the Work or
          Derivative Works a copy of this License; and

      (b) You must cause any modified files to carry prominent notices
          stating that You changed the files; and

      (c) You must retain, in the Source form of any Derivative Works
          that You distribute, all copyright, patent, trademark, and
          attribution notices from the Source form of the Work,
          excluding those notices that do not pertain to any part of
          the Derivative Works; and

      (d) If the Work includes a "NOTICE" text file as part of its
          distribution, then any Derivative Works that You distribute must
          include a readable copy of the attribution notices contained
          within such NOTICE file, excluding those notices that do not
          pertain to any part of the Derivative Works, in at least one
          of the following places: within a NOTICE text file distributed
          as part of the Derivative Works; within the Source form or
          documentation, if provided along with the Derivative Works; or,
          within a display generated by the Derivative Works, if and
          wherever such third-party notices normally appear. The contents
          of the NOTICE file are for informational purposes only and
          do not modify the License. You may add Your own attribution
          notices within Derivative Works that You distribute, alongside
          or as an addendum to the NOTICE text from the Work, provided
          that such additional attribution notices cannot be construed
          as modifying the License.

      You may add Your own copyright statement to Your modifications and
      may provide additional or different license terms and conditions
      for use, reproduction, or distribution of Your modifications, or
      for any such Derivative Works as a whole, provided Your use,
      reproduction, and distribution of the Work otherwise complies with
      the conditions stated in this License.

   5. Submission of Contributions. Unless You explicitly state otherwise,
      any Contribution intentionally submitted for inclusion in the Work
      by You to the Licensor shall be under the terms and conditions of
      this License, without any additional terms or conditions.
      Notwithstanding the above, nothing herein shall supersede or modify
      the terms of any separate license agreement you may have executed
      with Licensor regarding such Contributions.

   6. Trademarks. This License does not grant permission to use the trade
      names, trademarks, service marks, or product names of the Licensor,
      except as required for reasonable and customary use in describing the
      origin of the Work and reproducing the content of the NOTICE file.

   7. Disclaimer of Warranty. Unless required by applicable law or
      agreed to in writing, Licensor provides the Work (and each
      Contributor provides its Contributions) on an "AS IS" BASIS,
      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
      implied, including, without limitation, any warranties or conditions
      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
      PARTICULAR PURPOSE. You are solely responsible for determining the
      appropriateness of using or redistributing the Work and assume any
      risks associated with Your exercise of permissions under this License.

   8. Limitation of Liability. In no event and under no legal theory,
      whether in tort (including negligence), contract, or otherwise,
      unless required by applicable law (such as deliberate and grossly
      negligent acts) or agreed to in writing, shall any Contributor be
      liable to You for damages, including any direct, indirect, special,
      incidental, or consequential damages of any character arising as a
      result of this License or out of the use or inability to use the
      Work (including but not limited to damages for loss of goodwill,
      work stoppage, computer failure or malfunction, or any and all
      other commercial damages or losses), even if such Contributor
      has been advised of the possibility of such damages.

   9. Accepting Warranty or Additional Liability. While redistributing
      the Work or Derivative Works thereof, You may choose to offer,
      and charge a fee for, acceptance of support, warranty, indemnity,
      or other liability obligations and/or rights consistent with this
      License. However, in accepting such obligations, You may act only
      on Your own behalf and on Your sole responsibility, not on behalf
      of any other Contributor, and only if You agree to indemnify,
      defend, and hold each Contributor harmless for any liability
      incurred by, or claims asserted against, such Contributor by reason
      of your accepting any such warranty or additional liability.

   END OF TERMS AND CONDITIONS

   APPENDIX: How to apply the Apache License to your work.

      To apply the Apache License to your work, attach the following
      boilerplate notice, with the fields enclosed by brackets "[]"
      replaced with your own identifying information. (Don't include
      the brackets!)  The text should be enclosed in the appropriate
      comment syntax for the file format. We also recommend that a
      file or class name and description of purpose be included on the
      same "printed page" as the copyright notice for easier
      identification within third-party archives.

   Copyright [yyyy] [name of copyright owner]

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.


================================================
FILE: README.md
================================================
# nats-docker

[![License][License-Image]][License-Url]

This is the repository for building the official [NATS server Docker images]. If you
just want to use NATS server, then head over to [Docker Hub]. You don't need
this repository.

The rest of this readme is for image maintainers.

## Directory structure

The directories are structured in a way such that each NATS server release has
a directory. Each release version has a number of base image variants, such as
scratch on Linux or nanoserver on Windows.

```
nats-docker/
├── 2.9.x
│   ├── image variant 1
└───└── image variant 2
├── 2.10.x
│   ├── image variant 1
└───└── image variant 2
```

For the most part, image variant Dockerfiles will download the official NATS
server [release binaries] when building the server image and `COPY` a default
configuration file.

The Linux scratch image is a little special. It copies a server binary from the
Alpine image because the scratch image doesn't come with any tools to download
and untar binaries.

## Updating NATS server version

First, make sure you've published a new NATS server git tag and make sure the
[release binaries] and SHASUMS are ready to download.

Next, run the command below. This will update the version and hash of the NATS
server. If this is a patch release, it will update the existing directory.
However, if it is a minor or major version, it will create the new directory
(if required) from the latest minor version.

```
usage: ./update.py <server version>
       ./update.py 2.10.0
```

You can check what changed with `git diff`.

## Manual updates

This script doesn't update everything. Here are some other things you
may or may not want to update.

- The Ubuntu host version used for CI.
- The Windows host versions used for CI.
- The Alpine version

After you've updated everything that needs updating. Submit a PR to this repo.
Make sure CI passes.

## Publishing on Docker Hub

To publish your new changes to Docker Hub. Head over to
[docker-library/official-images]. You'll need to update the [nats IMF] file.

IMF stands for Internet Message Format. It's the format that Docker chose to
declare images, instead of something like YAML.

You'll need to update the git commit in this file.

```
GitCommit: 710f0ed18645d78e97fa7fd8cdf9b80dbe936eb6
```

Also handy to know, if you're testing and haven't merged your PR in
nats-io/nats-docker. You can tell Docker to pull a commit from a different
branch like this.

```
GitFetch: refs/heads/mybranch
GitCommit: 710f0ed18645d78e97fa7fd8cdf9b80dbe936eb6
```

Docker images will be built in the order they're specified in the IMF file.
This detail is very important because Windows images and the scratch image
depend on this behavior. Nanoserver images must be built after servercore
images. Scratch must be built after Alpine.

```
Tags: 2.1.0-windowsservercore-1809, windowsservercore-1809
Architectures: windows-amd64
Directory: 2.1.0/windowsservercore-1809
Constraints: windowsservercore-1809

Tags: 2.1.0-nanoserver-1809, nanoserver-1809
Architectures: windows-amd64
Directory: 2.1.0/nanoserver-1809
Constraints: nanoserver-1809, windowsservercore-1809
```

The names of the images also have to be consistent with the rest of the
official images. Make sure the names match existing image names. For example,
it should be `2.1.0-windowsservercore-1809`, not `2.1.0-windowsservercore1809`,
not `2.1.0-servercore-1809`.

[Docker Hub]: https://hub.docker.com/_/nats
[docker-library/official-images]: https://github.com/docker-library/official-images
[License-Image]: https://img.shields.io/badge/License-Apache2-blue.svg
[License-Url]: https://www.apache.org/licenses/LICENSE-2.0
[nats IMF]: https://github.com/docker-library/official-images/blob/master/library/nats
[NATS server Docker images]: https://hub.docker.com/_/nats
[release binaries]: https://github.com/nats-io/nats-server/releases


================================================
FILE: update.py
================================================
#!/usr/bin/env python3

import os
import re
import sys
import glob
import shutil
import typing
import urllib.request

semver_str = r"([0-9]+)\.([0-9]+)\.([0-9]+)(-(preview|rc|RC)\.([0-9]+))?"
sha256_str = r"[A-Fa-f0-9]{64}"
default_sha256 = "0000000000000000000000000000000000000000000000000000000000000000"


# Update the NATS_SERVER env variable across applicable files.
def update_env_var(base_dir: str, new_ver: str):
    files = [
        f"./{base_dir}/windowsservercore-ltsc2022/Dockerfile",
        f"./{base_dir}/windowsservercore-ltsc2025/Dockerfile",
        f"./{base_dir}/tests/build-images.sh",
        f"./{base_dir}/tests/run-images.sh",
        f"./{base_dir}/tests/build-images-ltsc2022.ps1",
        f"./{base_dir}/tests/build-images-ltsc2025.ps1",
        f"./{base_dir}/tests/run-images-ltsc2022.ps1",
        f"./{base_dir}/tests/run-images-ltsc2025.ps1",
    ] +  glob.glob(f"./{base_dir}/alpine*/Dockerfile")

    r = re.compile(r"(NATS_SERVER )" + semver_str)

    for f in files:
        with open(f, "r") as fd:
            data = fd.read()

        with open(f, "w") as fd:
            fd.write(r.sub(f"\g<1>{new_ver}", data))


# Update the nats:x.y.z tag across applicable files.
def update_tag_var(base_dir: str, new_ver: str):
    files = [
        f"./{base_dir}/nanoserver-ltsc2022/Dockerfile",
        f"./{base_dir}/nanoserver-ltsc2025/Dockerfile",
        f"./{base_dir}/scratch/Dockerfile",
    ]

    r = re.compile(r"(--from=nats:)" + semver_str)

    for f in files:
        with open(f, "r") as fd:
            data = fd.read()

        with open(f, "w") as fd:
            fd.write(r.sub(f"\g<1>{new_ver}", data))


# Update the nats:x.y.z tag across applicable files.
def update_preview_tag_var(base_dir: str, new_ver: str):
    files = [
        f"./{base_dir}/nanoserver-ltsc2022/Dockerfile.preview",
        f"./{base_dir}/nanoserver-ltsc2025/Dockerfile.preview",
        f"./{base_dir}/scratch/Dockerfile.preview",
    ]

    r = re.compile(r"(BASE_IMAGE=nats:)" + semver_str)

    for f in files:
        with open(f, "r") as fd:
            data = fd.read()

        with open(f, "w") as fd:
            fd.write(r.sub(f"\g<1>{new_ver}", data))


# Update the NATS SHASUM across applicable files.
def update_windows_shasums(base_dir: str, new_ver: str, shasums: typing.Dict):
    files = [
        f"{base_dir}/windowsservercore-ltsc2022/Dockerfile",
        f"{base_dir}/windowsservercore-ltsc2025/Dockerfile",
    ]

    key = f"nats-server-v{new_ver}-windows-amd64.zip"
    sha = shasums.get(key, default_sha256)

    r = re.compile(r"(NATS_SERVER_SHASUM )" + sha256_str)

    for f in files:
        with open(f, "r") as fd:
            data = fd.read()

        with open(f, "w") as fd:
            fd.write(r.sub(f"\g<1>{sha}", data))


def update_alpine_shasums(base_dir: str, new_ver: str, shasums: typing.Dict):
    file = glob.glob(f"{base_dir}/alpine*/Dockerfile")[0]

    with open(file, "r") as fd:
        data = fd.read()

    arches = ("arm64", "arm6", "arm7", "amd64", "386", "s390x", "ppc64le")
    if base_dir != "2.10.x":
        arches += ("loong64",)

    for arch in arches:
        key = f"nats-server-v{new_ver}-linux-{arch}.tar.gz"
        arch_sha = shasums.get(key, default_sha256)
        r = re.compile(f"(natsArch='{arch}'; )"+r"sha256='" + sha256_str + r"'")
        data = r.sub(f"\g<1>sha256='{arch_sha}'", data)

    with open(file, "w") as fd:
        fd.write(data)


def get_shasums(ver: str) -> typing.Dict:
    u = f"https://github.com/nats-io/nats-server/releases/download/v{ver}/SHA256SUMS"

    d = {}
    try:
        with urllib.request.urlopen(u) as resp:
            data = resp.readlines()

        for line in data:
            sps = line.split()
            if len(sps) != 2:
                continue
            d[sps[1].decode("utf-8")] = sps[0].decode("utf-8")
    except Exception as e:
        pass

    return d


# Get the base version directory for the new version.
def get_base_version(cdir: str, maj_ver: int, min_ver: int) -> str:
    r = re.compile(r"[0-9]+\.[0-9]+\.x")

    base_dir = None
    for f in os.listdir(base_dir):
        if not r.search(f):
            continue

        toks = f.split(".")
        if len(toks) != 3:
            continue

        # Explicit match on major and minor.
        # First precedence.
        if int(toks[0]) == maj_ver and int(toks[1]) == min_ver:
            return f

        # Directory has prior minor version.
        # Second precedence.
        if int(toks[0]) == maj_ver and int(toks[1]) == (min_ver - 1):
            base_dir = f

        # Directory has prior major version.
        # Third precedence.
        if not base_dir and int(toks[0]) == (maj_ver - 1):
            base_dir = f

    return base_dir


def ensure_dir(base_dir: str, maj_ver: int, min_ver: int) -> str:
    # Already exists, use that minor directory.
    if os.path.exists(f"{maj_ver}.{min_ver}.x"):
        return f"{maj_ver}.{min_ver}.x"

    # Create and copy the directory.
    shutil.copytree(base_dir, f"{maj_ver}.{min_ver}.x", symlinks=True)

    return f"{maj_ver}.{min_ver}.x"


if __name__ == "__main__":
    if len(sys.argv) != 2:
       print(f"usage: {sys.argv[0]} <version>")
       sys.exit(1)

    new_ver = sys.argv[1]
    if not re.compile(semver_str).match(new_ver):
        print(f"invalid version: {new_ver}")
        sys.exit(1)

    toks = new_ver.split(".")
    maj_ver = int(toks[0])
    min_ver = int(toks[1])

    base_dir = get_base_version(".", maj_ver, min_ver)
    if not base_dir:
        print(f"unable to find base version for {maj_ver}.{min_ver}.x")
        sys.exit(1)

    print(f"base dir: {base_dir}")
    print(f"new version: {new_ver}")

    print("downloading binary release shasums...")
    shasums = get_shasums(new_ver)

    # Ensure the new directory exists.
    base_dir = ensure_dir(base_dir, maj_ver, min_ver)

    print("updating local files...")
    update_env_var(base_dir, new_ver)
    update_tag_var(base_dir, new_ver)
    update_preview_tag_var(base_dir, new_ver)

    update_windows_shasums(base_dir, new_ver, shasums)
    update_alpine_shasums(base_dir, new_ver, shasums)

    print("update complete")
Download .txt
gitextract_6w3j__g3/

├── .github/
│   └── workflows/
│       ├── images.yaml
│       └── main.yaml
├── 2.10.x/
│   ├── alpine3.22/
│   │   ├── Dockerfile
│   │   ├── docker-entrypoint.sh
│   │   └── nats-server.conf
│   ├── nanoserver-ltsc2022/
│   │   ├── Dockerfile
│   │   ├── Dockerfile.preview
│   │   └── nats-server.conf
│   ├── nanoserver-ltsc2025/
│   │   ├── Dockerfile
│   │   ├── Dockerfile.preview
│   │   └── nats-server.conf
│   ├── scratch/
│   │   ├── Dockerfile
│   │   ├── Dockerfile.preview
│   │   └── nats-server.conf
│   ├── tests/
│   │   ├── build-images-ltsc2022.ps1
│   │   ├── build-images-ltsc2025.ps1
│   │   ├── build-images.sh
│   │   ├── run-images-ltsc2022.ps1
│   │   ├── run-images-ltsc2025.ps1
│   │   └── run-images.sh
│   ├── windowsservercore-ltsc2022/
│   │   ├── Dockerfile
│   │   └── nats-server.conf
│   └── windowsservercore-ltsc2025/
│       ├── Dockerfile
│       └── nats-server.conf
├── 2.11.x/
│   ├── alpine3.22/
│   │   ├── Dockerfile
│   │   ├── docker-entrypoint.sh
│   │   └── nats-server.conf
│   ├── nanoserver-ltsc2022/
│   │   ├── Dockerfile
│   │   ├── Dockerfile.preview
│   │   └── nats-server.conf
│   ├── nanoserver-ltsc2025/
│   │   ├── Dockerfile
│   │   ├── Dockerfile.preview
│   │   └── nats-server.conf
│   ├── scratch/
│   │   ├── Dockerfile
│   │   ├── Dockerfile.preview
│   │   └── nats-server.conf
│   ├── tests/
│   │   ├── build-images-ltsc2022.ps1
│   │   ├── build-images-ltsc2025.ps1
│   │   ├── build-images.sh
│   │   ├── run-images-ltsc2022.ps1
│   │   ├── run-images-ltsc2025.ps1
│   │   └── run-images.sh
│   ├── windowsservercore-ltsc2022/
│   │   ├── Dockerfile
│   │   └── nats-server.conf
│   └── windowsservercore-ltsc2025/
│       ├── Dockerfile
│       └── nats-server.conf
├── 2.12.x/
│   ├── alpine3.22/
│   │   ├── Dockerfile
│   │   ├── docker-entrypoint.sh
│   │   └── nats-server.conf
│   ├── nanoserver-ltsc2022/
│   │   ├── Dockerfile
│   │   ├── Dockerfile.preview
│   │   └── nats-server.conf
│   ├── nanoserver-ltsc2025/
│   │   ├── Dockerfile
│   │   ├── Dockerfile.preview
│   │   └── nats-server.conf
│   ├── scratch/
│   │   ├── Dockerfile
│   │   ├── Dockerfile.preview
│   │   └── nats-server.conf
│   ├── tests/
│   │   ├── build-images-ltsc2022.ps1
│   │   ├── build-images-ltsc2025.ps1
│   │   ├── build-images.sh
│   │   ├── run-images-ltsc2022.ps1
│   │   ├── run-images-ltsc2025.ps1
│   │   └── run-images.sh
│   ├── windowsservercore-ltsc2022/
│   │   ├── Dockerfile
│   │   └── nats-server.conf
│   └── windowsservercore-ltsc2025/
│       ├── Dockerfile
│       └── nats-server.conf
├── 2.14.x/
│   ├── alpine3.22/
│   │   ├── Dockerfile
│   │   ├── docker-entrypoint.sh
│   │   └── nats-server.conf
│   ├── nanoserver-ltsc2022/
│   │   ├── Dockerfile
│   │   ├── Dockerfile.preview
│   │   └── nats-server.conf
│   ├── nanoserver-ltsc2025/
│   │   ├── Dockerfile
│   │   ├── Dockerfile.preview
│   │   └── nats-server.conf
│   ├── scratch/
│   │   ├── Dockerfile
│   │   ├── Dockerfile.preview
│   │   └── nats-server.conf
│   ├── tests/
│   │   ├── build-images-ltsc2022.ps1
│   │   ├── build-images-ltsc2025.ps1
│   │   ├── build-images.sh
│   │   ├── run-images-ltsc2022.ps1
│   │   ├── run-images-ltsc2025.ps1
│   │   └── run-images.sh
│   ├── windowsservercore-ltsc2022/
│   │   ├── Dockerfile
│   │   └── nats-server.conf
│   └── windowsservercore-ltsc2025/
│       ├── Dockerfile
│       └── nats-server.conf
├── LICENSE
├── README.md
└── update.py
Download .txt
SYMBOL INDEX (8 symbols across 1 files)

FILE: update.py
  function update_env_var (line 17) | def update_env_var(base_dir: str, new_ver: str):
  function update_tag_var (line 40) | def update_tag_var(base_dir: str, new_ver: str):
  function update_preview_tag_var (line 58) | def update_preview_tag_var(base_dir: str, new_ver: str):
  function update_windows_shasums (line 76) | def update_windows_shasums(base_dir: str, new_ver: str, shasums: typing....
  function update_alpine_shasums (line 95) | def update_alpine_shasums(base_dir: str, new_ver: str, shasums: typing.D...
  function get_shasums (line 115) | def get_shasums(ver: str) -> typing.Dict:
  function get_base_version (line 135) | def get_base_version(cdir: str, maj_ver: int, min_ver: int) -> str:
  function ensure_dir (line 165) | def ensure_dir(base_dir: str, maj_ver: int, min_ver: int) -> str:
Condensed preview — 93 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (110K chars).
[
  {
    "path": ".github/workflows/images.yaml",
    "chars": 14092,
    "preview": "name: Build Images\n\non:\n  push:\n    tags:\n      - \"*\"\n\npermissions:\n  contents: read\n\nenv:\n  IMAGE_NAME: \"synadia/nats-s"
  },
  {
    "path": ".github/workflows/main.yaml",
    "chars": 1343,
    "preview": "name: Docker build testing\non: [push, pull_request]\n\npermissions:\n  contents: read\n\njobs:\n  linux:\n    name: Test Linux "
  },
  {
    "path": "2.10.x/alpine3.22/Dockerfile",
    "chars": 1610,
    "preview": "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\taar"
  },
  {
    "path": "2.10.x/alpine3.22/docker-entrypoint.sh",
    "chars": 341,
    "preview": "#!/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 hyphe"
  },
  {
    "path": "2.10.x/alpine3.22/nats-server.conf",
    "chars": 740,
    "preview": "# Client port of 4222 on all interfaces\nport: 4222\n\n# HTTP monitoring port\nmonitor_port: 8222\n\n# This is for clustering "
  },
  {
    "path": "2.10.x/nanoserver-ltsc2022/Dockerfile",
    "chars": 304,
    "preview": "FROM mcr.microsoft.com/windows/nanoserver:ltsc2022\nENV NATS_DOCKERIZED 1\n\nCOPY --from=nats:2.10.29-windowsservercore-lts"
  },
  {
    "path": "2.10.x/nanoserver-ltsc2022/Dockerfile.preview",
    "chars": 350,
    "preview": "ARG BASE_IMAGE=nats:2.10.29-windowsservercore-ltsc2022\nFROM $BASE_IMAGE AS base\n\nFROM mcr.microsoft.com/windows/nanoserv"
  },
  {
    "path": "2.10.x/nanoserver-ltsc2022/nats-server.conf",
    "chars": 740,
    "preview": "# Client port of 4222 on all interfaces\nport: 4222\n\n# HTTP monitoring port\nmonitor_port: 8222\n\n# This is for clustering "
  },
  {
    "path": "2.10.x/nanoserver-ltsc2025/Dockerfile",
    "chars": 304,
    "preview": "FROM mcr.microsoft.com/windows/nanoserver:ltsc2025\nENV NATS_DOCKERIZED 1\n\nCOPY --from=nats:2.10.29-windowsservercore-lts"
  },
  {
    "path": "2.10.x/nanoserver-ltsc2025/Dockerfile.preview",
    "chars": 350,
    "preview": "ARG BASE_IMAGE=nats:2.10.29-windowsservercore-ltsc2025\nFROM $BASE_IMAGE AS base\n\nFROM mcr.microsoft.com/windows/nanoserv"
  },
  {
    "path": "2.10.x/nanoserver-ltsc2025/nats-server.conf",
    "chars": 740,
    "preview": "# Client port of 4222 on all interfaces\nport: 4222\n\n# HTTP monitoring port\nmonitor_port: 8222\n\n# This is for clustering "
  },
  {
    "path": "2.10.x/scratch/Dockerfile",
    "chars": 237,
    "preview": "FROM scratch\nENV PATH=\"$PATH:/\"\n\nCOPY --from=nats:2.10.29-alpine3.22 /usr/local/bin/nats-server /nats-server\nCOPY nats-s"
  },
  {
    "path": "2.10.x/scratch/Dockerfile.preview",
    "chars": 283,
    "preview": "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/"
  },
  {
    "path": "2.10.x/scratch/nats-server.conf",
    "chars": 740,
    "preview": "# Client port of 4222 on all interfaces\nport: 4222\n\n# HTTP monitoring port\nmonitor_port: 8222\n\n# This is for clustering "
  },
  {
    "path": "2.10.x/tests/build-images-ltsc2022.ps1",
    "chars": 772,
    "preview": "# Show statements as they run.\nSet-PSDebug -Trace 2\n# Exit on error.\n$ErrorActionPreference = \"Stop\"\n\n$ver = 'NATS_SERVE"
  },
  {
    "path": "2.10.x/tests/build-images-ltsc2025.ps1",
    "chars": 772,
    "preview": "# Show statements as they run.\nSet-PSDebug -Trace 2\n# Exit on error.\n$ErrorActionPreference = \"Stop\"\n\n$ver = 'NATS_SERVE"
  },
  {
    "path": "2.10.x/tests/build-images.sh",
    "chars": 195,
    "preview": "#!/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"
  },
  {
    "path": "2.10.x/tests/run-images-ltsc2022.ps1",
    "chars": 512,
    "preview": "# Show statements as they run.\nSet-PSDebug -Trace 2\n# Exit on error.\n$ErrorActionPreference = \"Stop\"\n\n$ver = \"NATS_SERVE"
  },
  {
    "path": "2.10.x/tests/run-images-ltsc2025.ps1",
    "chars": 534,
    "preview": "# Show statements as they run.\nSet-PSDebug -Trace 2\n# Exit on error.\n$ErrorActionPreference = \"Stop\"\n\n$ver = \"NATS_SERVE"
  },
  {
    "path": "2.10.x/tests/run-images.sh",
    "chars": 312,
    "preview": "#!/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"
  },
  {
    "path": "2.10.x/windowsservercore-ltsc2022/Dockerfile",
    "chars": 1370,
    "preview": "FROM mcr.microsoft.com/windows/servercore:ltsc2022\n\n# Enable exit on error.\nSHELL [\"powershell\", \"-Command\", \"$ErrorActi"
  },
  {
    "path": "2.10.x/windowsservercore-ltsc2022/nats-server.conf",
    "chars": 740,
    "preview": "# Client port of 4222 on all interfaces\nport: 4222\n\n# HTTP monitoring port\nmonitor_port: 8222\n\n# This is for clustering "
  },
  {
    "path": "2.10.x/windowsservercore-ltsc2025/Dockerfile",
    "chars": 1425,
    "preview": "FROM mcr.microsoft.com/windows/servercore:ltsc2025\n\n# Enable exit on error.\nSHELL [\"powershell\", \"-Command\", \"$ErrorActi"
  },
  {
    "path": "2.10.x/windowsservercore-ltsc2025/nats-server.conf",
    "chars": 740,
    "preview": "# Client port of 4222 on all interfaces\nport: 4222\n\n# HTTP monitoring port\nmonitor_port: 8222\n\n# This is for clustering "
  },
  {
    "path": "2.11.x/alpine3.22/Dockerfile",
    "chars": 2318,
    "preview": "FROM alpine:3.22\n\nENV NATS_SERVER 2.11.17\n\nLABEL org.opencontainers.image.title=\"NATS Server\" \\\n      org.opencontainers"
  },
  {
    "path": "2.11.x/alpine3.22/docker-entrypoint.sh",
    "chars": 341,
    "preview": "#!/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 hyphe"
  },
  {
    "path": "2.11.x/alpine3.22/nats-server.conf",
    "chars": 740,
    "preview": "# Client port of 4222 on all interfaces\nport: 4222\n\n# HTTP monitoring port\nmonitor_port: 8222\n\n# This is for clustering "
  },
  {
    "path": "2.11.x/nanoserver-ltsc2022/Dockerfile",
    "chars": 304,
    "preview": "FROM mcr.microsoft.com/windows/nanoserver:ltsc2022\nENV NATS_DOCKERIZED 1\n\nCOPY --from=nats:2.11.17-windowsservercore-lts"
  },
  {
    "path": "2.11.x/nanoserver-ltsc2022/Dockerfile.preview",
    "chars": 350,
    "preview": "ARG BASE_IMAGE=nats:2.11.17-windowsservercore-ltsc2022\nFROM $BASE_IMAGE AS base\n\nFROM mcr.microsoft.com/windows/nanoserv"
  },
  {
    "path": "2.11.x/nanoserver-ltsc2022/nats-server.conf",
    "chars": 740,
    "preview": "# Client port of 4222 on all interfaces\nport: 4222\n\n# HTTP monitoring port\nmonitor_port: 8222\n\n# This is for clustering "
  },
  {
    "path": "2.11.x/nanoserver-ltsc2025/Dockerfile",
    "chars": 304,
    "preview": "FROM mcr.microsoft.com/windows/nanoserver:ltsc2025\nENV NATS_DOCKERIZED 1\n\nCOPY --from=nats:2.11.17-windowsservercore-lts"
  },
  {
    "path": "2.11.x/nanoserver-ltsc2025/Dockerfile.preview",
    "chars": 350,
    "preview": "ARG BASE_IMAGE=nats:2.11.17-windowsservercore-ltsc2025\nFROM $BASE_IMAGE AS base\n\nFROM mcr.microsoft.com/windows/nanoserv"
  },
  {
    "path": "2.11.x/nanoserver-ltsc2025/nats-server.conf",
    "chars": 740,
    "preview": "# Client port of 4222 on all interfaces\nport: 4222\n\n# HTTP monitoring port\nmonitor_port: 8222\n\n# This is for clustering "
  },
  {
    "path": "2.11.x/scratch/Dockerfile",
    "chars": 237,
    "preview": "FROM scratch\nENV PATH=\"$PATH:/\"\n\nCOPY --from=nats:2.11.17-alpine3.22 /usr/local/bin/nats-server /nats-server\nCOPY nats-s"
  },
  {
    "path": "2.11.x/scratch/Dockerfile.preview",
    "chars": 283,
    "preview": "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/"
  },
  {
    "path": "2.11.x/scratch/nats-server.conf",
    "chars": 740,
    "preview": "# Client port of 4222 on all interfaces\nport: 4222\n\n# HTTP monitoring port\nmonitor_port: 8222\n\n# This is for clustering "
  },
  {
    "path": "2.11.x/tests/build-images-ltsc2022.ps1",
    "chars": 772,
    "preview": "# Show statements as they run.\nSet-PSDebug -Trace 2\n# Exit on error.\n$ErrorActionPreference = \"Stop\"\n\n$ver = 'NATS_SERVE"
  },
  {
    "path": "2.11.x/tests/build-images-ltsc2025.ps1",
    "chars": 772,
    "preview": "# Show statements as they run.\nSet-PSDebug -Trace 2\n# Exit on error.\n$ErrorActionPreference = \"Stop\"\n\n$ver = 'NATS_SERVE"
  },
  {
    "path": "2.11.x/tests/build-images.sh",
    "chars": 195,
    "preview": "#!/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"
  },
  {
    "path": "2.11.x/tests/run-images-ltsc2022.ps1",
    "chars": 512,
    "preview": "# Show statements as they run.\nSet-PSDebug -Trace 2\n# Exit on error.\n$ErrorActionPreference = \"Stop\"\n\n$ver = \"NATS_SERVE"
  },
  {
    "path": "2.11.x/tests/run-images-ltsc2025.ps1",
    "chars": 534,
    "preview": "# Show statements as they run.\nSet-PSDebug -Trace 2\n# Exit on error.\n$ErrorActionPreference = \"Stop\"\n\n$ver = \"NATS_SERVE"
  },
  {
    "path": "2.11.x/tests/run-images.sh",
    "chars": 312,
    "preview": "#!/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"
  },
  {
    "path": "2.11.x/windowsservercore-ltsc2022/Dockerfile",
    "chars": 1912,
    "preview": "FROM mcr.microsoft.com/windows/servercore:ltsc2022\n\n# Enable exit on error.\nSHELL [\"powershell\", \"-Command\", \"$ErrorActi"
  },
  {
    "path": "2.11.x/windowsservercore-ltsc2022/nats-server.conf",
    "chars": 740,
    "preview": "# Client port of 4222 on all interfaces\nport: 4222\n\n# HTTP monitoring port\nmonitor_port: 8222\n\n# This is for clustering "
  },
  {
    "path": "2.11.x/windowsservercore-ltsc2025/Dockerfile",
    "chars": 1967,
    "preview": "FROM mcr.microsoft.com/windows/servercore:ltsc2025\n\n# Enable exit on error.\nSHELL [\"powershell\", \"-Command\", \"$ErrorActi"
  },
  {
    "path": "2.11.x/windowsservercore-ltsc2025/nats-server.conf",
    "chars": 740,
    "preview": "# Client port of 4222 on all interfaces\nport: 4222\n\n# HTTP monitoring port\nmonitor_port: 8222\n\n# This is for clustering "
  },
  {
    "path": "2.12.x/alpine3.22/Dockerfile",
    "chars": 2322,
    "preview": "FROM alpine:3.22\n\nENV NATS_SERVER 2.12.9-RC.1\n\nLABEL org.opencontainers.image.title=\"NATS Server\" \\\n      org.opencontai"
  },
  {
    "path": "2.12.x/alpine3.22/docker-entrypoint.sh",
    "chars": 341,
    "preview": "#!/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 hyphe"
  },
  {
    "path": "2.12.x/alpine3.22/nats-server.conf",
    "chars": 740,
    "preview": "# Client port of 4222 on all interfaces\nport: 4222\n\n# HTTP monitoring port\nmonitor_port: 8222\n\n# This is for clustering "
  },
  {
    "path": "2.12.x/nanoserver-ltsc2022/Dockerfile",
    "chars": 308,
    "preview": "FROM mcr.microsoft.com/windows/nanoserver:ltsc2022\nENV NATS_DOCKERIZED 1\n\nCOPY --from=nats:2.12.9-RC.1-windowsservercore"
  },
  {
    "path": "2.12.x/nanoserver-ltsc2022/Dockerfile.preview",
    "chars": 354,
    "preview": "ARG BASE_IMAGE=nats:2.12.9-RC.1-windowsservercore-ltsc2022\nFROM $BASE_IMAGE AS base\n\nFROM mcr.microsoft.com/windows/nano"
  },
  {
    "path": "2.12.x/nanoserver-ltsc2022/nats-server.conf",
    "chars": 740,
    "preview": "# Client port of 4222 on all interfaces\nport: 4222\n\n# HTTP monitoring port\nmonitor_port: 8222\n\n# This is for clustering "
  },
  {
    "path": "2.12.x/nanoserver-ltsc2025/Dockerfile",
    "chars": 308,
    "preview": "FROM mcr.microsoft.com/windows/nanoserver:ltsc2025\nENV NATS_DOCKERIZED 1\n\nCOPY --from=nats:2.12.9-RC.1-windowsservercore"
  },
  {
    "path": "2.12.x/nanoserver-ltsc2025/Dockerfile.preview",
    "chars": 354,
    "preview": "ARG BASE_IMAGE=nats:2.12.9-RC.1-windowsservercore-ltsc2025\nFROM $BASE_IMAGE AS base\n\nFROM mcr.microsoft.com/windows/nano"
  },
  {
    "path": "2.12.x/nanoserver-ltsc2025/nats-server.conf",
    "chars": 740,
    "preview": "# Client port of 4222 on all interfaces\nport: 4222\n\n# HTTP monitoring port\nmonitor_port: 8222\n\n# This is for clustering "
  },
  {
    "path": "2.12.x/scratch/Dockerfile",
    "chars": 241,
    "preview": "FROM scratch\nENV PATH=\"$PATH:/\"\n\nCOPY --from=nats:2.12.9-RC.1-alpine3.22 /usr/local/bin/nats-server /nats-server\nCOPY na"
  },
  {
    "path": "2.12.x/scratch/Dockerfile.preview",
    "chars": 287,
    "preview": "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 /"
  },
  {
    "path": "2.12.x/scratch/nats-server.conf",
    "chars": 740,
    "preview": "# Client port of 4222 on all interfaces\nport: 4222\n\n# HTTP monitoring port\nmonitor_port: 8222\n\n# This is for clustering "
  },
  {
    "path": "2.12.x/tests/build-images-ltsc2022.ps1",
    "chars": 776,
    "preview": "# Show statements as they run.\nSet-PSDebug -Trace 2\n# Exit on error.\n$ErrorActionPreference = \"Stop\"\n\n$ver = 'NATS_SERVE"
  },
  {
    "path": "2.12.x/tests/build-images-ltsc2025.ps1",
    "chars": 776,
    "preview": "# Show statements as they run.\nSet-PSDebug -Trace 2\n# Exit on error.\n$ErrorActionPreference = \"Stop\"\n\n$ver = 'NATS_SERVE"
  },
  {
    "path": "2.12.x/tests/build-images.sh",
    "chars": 199,
    "preview": "#!/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]}-alp"
  },
  {
    "path": "2.12.x/tests/run-images-ltsc2022.ps1",
    "chars": 516,
    "preview": "# Show statements as they run.\nSet-PSDebug -Trace 2\n# Exit on error.\n$ErrorActionPreference = \"Stop\"\n\n$ver = \"NATS_SERVE"
  },
  {
    "path": "2.12.x/tests/run-images-ltsc2025.ps1",
    "chars": 538,
    "preview": "# Show statements as they run.\nSet-PSDebug -Trace 2\n# Exit on error.\n$ErrorActionPreference = \"Stop\"\n\n$ver = \"NATS_SERVE"
  },
  {
    "path": "2.12.x/tests/run-images.sh",
    "chars": 316,
    "preview": "#!/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]}-scrat"
  },
  {
    "path": "2.12.x/windowsservercore-ltsc2022/Dockerfile",
    "chars": 1916,
    "preview": "FROM mcr.microsoft.com/windows/servercore:ltsc2022\n\n# Enable exit on error.\nSHELL [\"powershell\", \"-Command\", \"$ErrorActi"
  },
  {
    "path": "2.12.x/windowsservercore-ltsc2022/nats-server.conf",
    "chars": 740,
    "preview": "# Client port of 4222 on all interfaces\nport: 4222\n\n# HTTP monitoring port\nmonitor_port: 8222\n\n# This is for clustering "
  },
  {
    "path": "2.12.x/windowsservercore-ltsc2025/Dockerfile",
    "chars": 1971,
    "preview": "FROM mcr.microsoft.com/windows/servercore:ltsc2025\n\n# Enable exit on error.\nSHELL [\"powershell\", \"-Command\", \"$ErrorActi"
  },
  {
    "path": "2.12.x/windowsservercore-ltsc2025/nats-server.conf",
    "chars": 740,
    "preview": "# Client port of 4222 on all interfaces\nport: 4222\n\n# HTTP monitoring port\nmonitor_port: 8222\n\n# This is for clustering "
  },
  {
    "path": "2.14.x/alpine3.22/Dockerfile",
    "chars": 2322,
    "preview": "FROM alpine:3.22\n\nENV NATS_SERVER 2.14.1-RC.1\n\nLABEL org.opencontainers.image.title=\"NATS Server\" \\\n      org.opencontai"
  },
  {
    "path": "2.14.x/alpine3.22/docker-entrypoint.sh",
    "chars": 341,
    "preview": "#!/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 hyphe"
  },
  {
    "path": "2.14.x/alpine3.22/nats-server.conf",
    "chars": 740,
    "preview": "# Client port of 4222 on all interfaces\nport: 4222\n\n# HTTP monitoring port\nmonitor_port: 8222\n\n# This is for clustering "
  },
  {
    "path": "2.14.x/nanoserver-ltsc2022/Dockerfile",
    "chars": 308,
    "preview": "FROM mcr.microsoft.com/windows/nanoserver:ltsc2022\nENV NATS_DOCKERIZED 1\n\nCOPY --from=nats:2.14.1-RC.1-windowsservercore"
  },
  {
    "path": "2.14.x/nanoserver-ltsc2022/Dockerfile.preview",
    "chars": 354,
    "preview": "ARG BASE_IMAGE=nats:2.14.1-RC.1-windowsservercore-ltsc2022\nFROM $BASE_IMAGE AS base\n\nFROM mcr.microsoft.com/windows/nano"
  },
  {
    "path": "2.14.x/nanoserver-ltsc2022/nats-server.conf",
    "chars": 740,
    "preview": "# Client port of 4222 on all interfaces\nport: 4222\n\n# HTTP monitoring port\nmonitor_port: 8222\n\n# This is for clustering "
  },
  {
    "path": "2.14.x/nanoserver-ltsc2025/Dockerfile",
    "chars": 308,
    "preview": "FROM mcr.microsoft.com/windows/nanoserver:ltsc2025\nENV NATS_DOCKERIZED 1\n\nCOPY --from=nats:2.14.1-RC.1-windowsservercore"
  },
  {
    "path": "2.14.x/nanoserver-ltsc2025/Dockerfile.preview",
    "chars": 354,
    "preview": "ARG BASE_IMAGE=nats:2.14.1-RC.1-windowsservercore-ltsc2025\nFROM $BASE_IMAGE AS base\n\nFROM mcr.microsoft.com/windows/nano"
  },
  {
    "path": "2.14.x/nanoserver-ltsc2025/nats-server.conf",
    "chars": 740,
    "preview": "# Client port of 4222 on all interfaces\nport: 4222\n\n# HTTP monitoring port\nmonitor_port: 8222\n\n# This is for clustering "
  },
  {
    "path": "2.14.x/scratch/Dockerfile",
    "chars": 241,
    "preview": "FROM scratch\nENV PATH=\"$PATH:/\"\n\nCOPY --from=nats:2.14.1-RC.1-alpine3.22 /usr/local/bin/nats-server /nats-server\nCOPY na"
  },
  {
    "path": "2.14.x/scratch/Dockerfile.preview",
    "chars": 287,
    "preview": "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 /"
  },
  {
    "path": "2.14.x/scratch/nats-server.conf",
    "chars": 740,
    "preview": "# Client port of 4222 on all interfaces\nport: 4222\n\n# HTTP monitoring port\nmonitor_port: 8222\n\n# This is for clustering "
  },
  {
    "path": "2.14.x/tests/build-images-ltsc2022.ps1",
    "chars": 776,
    "preview": "# Show statements as they run.\nSet-PSDebug -Trace 2\n# Exit on error.\n$ErrorActionPreference = \"Stop\"\n\n$ver = 'NATS_SERVE"
  },
  {
    "path": "2.14.x/tests/build-images-ltsc2025.ps1",
    "chars": 776,
    "preview": "# Show statements as they run.\nSet-PSDebug -Trace 2\n# Exit on error.\n$ErrorActionPreference = \"Stop\"\n\n$ver = 'NATS_SERVE"
  },
  {
    "path": "2.14.x/tests/build-images.sh",
    "chars": 199,
    "preview": "#!/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]}-alp"
  },
  {
    "path": "2.14.x/tests/run-images-ltsc2022.ps1",
    "chars": 516,
    "preview": "# Show statements as they run.\nSet-PSDebug -Trace 2\n# Exit on error.\n$ErrorActionPreference = \"Stop\"\n\n$ver = \"NATS_SERVE"
  },
  {
    "path": "2.14.x/tests/run-images-ltsc2025.ps1",
    "chars": 538,
    "preview": "# Show statements as they run.\nSet-PSDebug -Trace 2\n# Exit on error.\n$ErrorActionPreference = \"Stop\"\n\n$ver = \"NATS_SERVE"
  },
  {
    "path": "2.14.x/tests/run-images.sh",
    "chars": 316,
    "preview": "#!/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]}-scrat"
  },
  {
    "path": "2.14.x/windowsservercore-ltsc2022/Dockerfile",
    "chars": 1916,
    "preview": "FROM mcr.microsoft.com/windows/servercore:ltsc2022\n\n# Enable exit on error.\nSHELL [\"powershell\", \"-Command\", \"$ErrorActi"
  },
  {
    "path": "2.14.x/windowsservercore-ltsc2022/nats-server.conf",
    "chars": 740,
    "preview": "# Client port of 4222 on all interfaces\nport: 4222\n\n# HTTP monitoring port\nmonitor_port: 8222\n\n# This is for clustering "
  },
  {
    "path": "2.14.x/windowsservercore-ltsc2025/Dockerfile",
    "chars": 1971,
    "preview": "FROM mcr.microsoft.com/windows/servercore:ltsc2025\n\n# Enable exit on error.\nSHELL [\"powershell\", \"-Command\", \"$ErrorActi"
  },
  {
    "path": "2.14.x/windowsservercore-ltsc2025/nats-server.conf",
    "chars": 740,
    "preview": "# Client port of 4222 on all interfaces\nport: 4222\n\n# HTTP monitoring port\nmonitor_port: 8222\n\n# This is for clustering "
  },
  {
    "path": "LICENSE",
    "chars": 11357,
    "preview": "                                 Apache License\n                           Version 2.0, January 2004\n                   "
  },
  {
    "path": "README.md",
    "chars": 3883,
    "preview": "# nats-docker\n\n[![License][License-Image]][License-Url]\n\nThis is the repository for building the official [NATS server D"
  },
  {
    "path": "update.py",
    "chars": 6197,
    "preview": "#!/usr/bin/env python3\n\nimport os\nimport re\nimport sys\nimport glob\nimport shutil\nimport typing\nimport urllib.request\n\nse"
  }
]

About this extraction

This page contains the full source code of the nats-io/nats-docker GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 93 files (96.5 KB), approximately 32.4k tokens, and a symbol index with 8 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.

Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.

Copied to clipboard!