seabopo/http-echo

By seabopo

Updated about 1 month ago

Unofficial HTTP-ECHO images for Windows Nano Server.

Image

947

HTTP-ECHO Images for Windows Nano Server

HTTP-ECHO by HashiCorp is a small go web server that serves a single HTTP web page whose content is determined by the Docker image startup parameters. See the HTTP-ECHO documentation for a full description.

The official HTTP-ECHO Docker repo only supports a linux/amd64 image. This repo adds support for Windows Nano Server based on Microsoft's PowerShell images.

Images / Tags:

  • http-echo:nanoserver-1809
  • http-echo:nanoserver-1809-v0.2.3
  • http-echo:nanoserver-ltsc-2022
  • http-echo:nanoserver-ltsc-2022-v2.7.3


Usage

Sample Docker command to expose run the image on port 8080 of the Docker host:

docker run -p 8080:80 hashicorp/http-echo -text="hello world" -listen=:80


Dockerfile

FROM mcr.microsoft.com/powershell:nanoserver-1809

SHELL ["pwsh", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]

RUN New-Item \
        -ItemType directory \
        -Path "/http-echo"; \
    Invoke-WebRequest \
        -Uri "https://github.com/hashicorp/http-echo/releases/download/v0.2.3/http-echo_0.2.3_windows_amd64.zip" \
        -OutFile "/http-echo/http-echo.zip"; \
    Expand-Archive \
        -Path "/http-echo/http-echo.zip" \
        -DestinationPath "/http-echo/" \
        -Force; \
    Rename-Item \
        -Path "/http-echo/http-echo" \
        -NewName "http-echo.exe"; \
    Remove-Item \
        -Path "/http-echo/http-echo.zip" \
        -Force;

EXPOSE 80
ENTRYPOINT [ "/httpecho/http-echo.exe", "-listen=:80", "-text=I'm Up!" ]

LABEL org.opencontainers.image.title="HTTP-Echo" \
      org.opencontainers.image.description="A tiny go web server that echos what you start it with!" \
      org.opencontainers.image.documentation="https://github.com/hashicorp/http-echo" \
      org.opencontainers.image.base.name="mcr.microsoft.com/powershell:nanoserver-1809" \
      org.opencontainers.image.version="v0.2.3" \
      org.opencontainers.image.url="https://hub.docker.com/r/seabopo/http-echo" \
      org.opencontainers.image.vendor="seabopo" \
      org.opencontainers.image.authors="seabopo @ Azure Devops / GitHub"

Docker Pull Command

docker pull seabopo/http-echo