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

How do I expose the port of the java service? #853

Open
guoqc3 opened this issue Nov 8, 2024 · 0 comments
Open

How do I expose the port of the java service? #853

guoqc3 opened this issue Nov 8, 2024 · 0 comments

Comments

@guoqc3
Copy link

guoqc3 commented Nov 8, 2024

Operating system

RockyLinux 8.7

Description

I started my java application in the startup windows server and registered it with nacos, but the host cannot access the java service started in my windows container. How do I expose the port of the java service? I added java server port 81 exposure in docker-compose.yml, but access denied: curl 192.168.1.1:81

Docker compose

version: "3"

services:
windows:
image: dockurr/windows:latest
container_name: windows
devices:
- /dev/kvm:/dev/kvm
cap_add:
- NET_ADMIN
ports:
- 8006:8006
- 81:81
- 3389:3389/tcp
- 3389:3389/udp
volumes:
- ./storage:/storage # 假设本地 ISO 文件位于当前目录下的 storage 文件夹内
- /data/work_pkg:/data
environment:
VERSION: "file:///storage/custom.iso" # 使用本地 ISO 文件
RAM_SIZE: "8G" # 分配 8GB 内存
CPU_CORES: "4" # 分配 4 个 CPU 核心
DISK_SIZE: "256G" # 设置硬盘大小为 256GB
stop_grace_period: 2m
restart: on-failure

Docker log

curl: (7) Failed to connect to 192.168.1.1 port 81: Connection refused

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