Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create custom docker image with reverse proxy(e.g caddy) on port 8080 from dockurr/windows base image. #965

Open
rishu488 opened this issue Dec 9, 2024 · 0 comments

Comments

@rishu488
Copy link

rishu488 commented Dec 9, 2024

Operating system

docker desktop (linux container)

Description

Usecase
Create custom docker image with reverse proxy(e.g caddy) on port 8080 using dockurr/windows as a base image to forward traffic to noVNC client running on 8006.

Sample Dockerfile

FROM dockurr/windows:latest
WORKDIR /

# Set environment variables
ENV VERSION="win11"
ENV CADDY_VERSION=2.7.6


# Download and install Caddy
RUN curl -L https://github.com/caddyserver/caddy/releases/download/v"$CADDY_VERSION"/caddy_"$CADDY_VERSION"_linux_amd64.tar.gz -o caddy_"$CADDY_VERSION"_linux_amd64.tar.gz && \
   mkdir caddy-download-"$CADDY_VERSION" && tar -xvf caddy_"$CADDY_VERSION"_linux_amd64.tar.gz -C ./caddy-download-"$CADDY_VERSION" && \
   mv ./caddy-download-"$CADDY_VERSION"/caddy /usr/local/bin/

# Copy files
COPY Caddyfile /Caddyfile
COPY entrypoint.sh /entrypoint.sh

# Ensure entrypoint.sh is executable
RUN chmod +x /entrypoint.sh

EXPOSE 8006 3389 5900 8080

# Set the entrypoint
ENTRYPOINT [ "/entrypoint.sh" ]

** Entrypoint.sh**

`#!/bin/sh

# Start Caddy server to reverse-proxy noVNC to port 8080

caddy start -c /Caddyfile --pidfile /var/caddy.pid

`

** Caddyfile**

`:8080

route *  {
	reverse_proxy 127.0.0.1:8006
}


`

Command Used to Build Docker Image
docker build -t windows-vnc-vm . && docker run -p 8006:8006 -p 5900:5900 -p 8080:8080 --device=/dev/kvm --device=/dev/net/tun --cap-add NET_ADMIN --stop-timeout 120 windows-vnc-vm

Expected Result
Once windows VM is up and running, we should be able to connect to VM using webclient (no-vnc) on port 8080

Current Result
Once VM is downloaded and started but its not able to run on 8080 , its only running on 8006.

Docker compose

NA

Docker log

NA

Screenshots (optional)

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant