:7788
respond "Hello, world!"
Yes, finally saw “Hello world” from Caddy server, it works. if :7788
PS C:\ProgramData\chocolatey\lib\curl\tools\curl-8.6.0_1-win64-mingw\bin> ./curl http://localhost:7788 -v
* Host localhost:7788 was resolved.
* IPv6: ::1
* IPv4: 127.0.0.1
* Trying [::1]:7788...
* Connected to localhost (::1) port 7788
> GET / HTTP/1.1
> Host: localhost:7788
> User-Agent: curl/8.6.0
> Accept: */*
>
< HTTP/1.1 200 OK
< Content-Type: text/plain; charset=utf-8
< Server: Caddy
< Date: Thu, 14 Mar 2024 08:40:16 GMT
< Content-Length: 13
<
Hello, world!* Connection #0 to host localhost left intact
PS C:\ProgramData\chocolatey\lib\curl\tools\curl-8.6.0_1-win64-mingw\bin>
But if :80, still not work
:80
respond "Hello, world!"
PS C:\ProgramData\chocolatey\lib\curl\tools\curl-8.6.0_1-win64-mingw\bin> ./curl http://localhost -v
* Host localhost:80 was resolved.
* IPv6: ::1
* IPv4: 127.0.0.1
* Trying [::1]:80...
* Trying 127.0.0.1:80...
* connect to ::1 port 80 from :: port 5655 failed: Connection refused
* connect to 127.0.0.1 port 80 from 0.0.0.0 port 5656 failed: Connection refused
* Failed to connect to localhost port 80 after 2247 ms: Couldn't connect to server
* Closing connection
curl: (7) Failed to connect to localhost port 80 after 2247 ms: Couldn't connect to server
PS C:\ProgramData\chocolatey\lib\curl\tools\curl-8.6.0_1-win64-mingw\bin>
and I think port 80 is free now, can not find port 80 from below command
netsh http show servicestate view=request
Here is the “docker container inspect [id of container]” for “:7788”
PS C:\ProgramData\chocolatey\lib\curl\tools\curl-8.6.0_1-win64-mingw\bin> docker container inspect aa6b4201e4f2ddd18bd79efa6aa7d34d93c61ab4941aca915d4a2232fe0fe48b
[
{
"Id": "aa6b4201e4f2ddd18bd79efa6aa7d34d93c61ab4941aca915d4a2232fe0fe48b",
"Created": "2024-03-14T09:04:14.128347951Z",
"Path": "caddy",
"Args": [
"run",
"--config",
"/etc/caddy/Caddyfile",
"--adapter",
"caddyfile"
],
"State": {
"Status": "running",
"Running": true,
"Paused": false,
"Restarting": false,
"OOMKilled": false,
"Dead": false,
"Pid": 42745,
"ExitCode": 0,
"Error": "",
"StartedAt": "2024-03-14T09:04:14.879760109Z",
"FinishedAt": "0001-01-01T00:00:00Z"
},
"Image": "sha256:572904a7f82f89d27e4f64f4a7d9807b77cfa233825107d13171014254a06f4e",
"ResolvConfPath": "/var/lib/docker/containers/aa6b4201e4f2ddd18bd79efa6aa7d34d93c61ab4941aca915d4a2232fe0fe48b/resolv.conf",
"HostnamePath": "/var/lib/docker/containers/aa6b4201e4f2ddd18bd79efa6aa7d34d93c61ab4941aca915d4a2232fe0fe48b/hostname",
"HostsPath": "/var/lib/docker/containers/aa6b4201e4f2ddd18bd79efa6aa7d34d93c61ab4941aca915d4a2232fe0fe48b/hosts",
"LogPath": "/var/lib/docker/containers/aa6b4201e4f2ddd18bd79efa6aa7d34d93c61ab4941aca915d4a2232fe0fe48b/aa6b4201e4f2ddd18bd79efa6aa7d34d93c61ab4941aca915d4a2232fe0fe48b-json.log",
"Name": "/myapp_caddy.1.rdbxu8iy62gv8erzmov5eif6s",
"RestartCount": 0,
"Driver": "overlay2",
"Platform": "linux",
"MountLabel": "",
"ProcessLabel": "",
"AppArmorProfile": "",
"ExecIDs": null,
"HostConfig": {
"Binds": null,
"ContainerIDFile": "",
"LogConfig": {
"Type": "json-file",
"Config": {}
},
"NetworkMode": "default",
"PortBindings": {},
"RestartPolicy": {
"Name": "no",
"MaximumRetryCount": 0
},
"AutoRemove": false,
"VolumeDriver": "",
"VolumesFrom": null,
"ConsoleSize": [
0,
0
],
"CapAdd": null,
"CapDrop": null,
"CgroupnsMode": "host",
"Dns": null,
"DnsOptions": null,
"DnsSearch": null,
"ExtraHosts": null,
"GroupAdd": null,
"IpcMode": "private",
"Cgroup": "",
"Links": null,
"OomScoreAdj": 0,
"PidMode": "",
"Privileged": false,
"PublishAllPorts": false,
"ReadonlyRootfs": false,
"SecurityOpt": null,
"UTSMode": "",
"UsernsMode": "",
"ShmSize": 67108864,
"Runtime": "runc",
"Isolation": "default",
"CpuShares": 0,
"Memory": 0,
"NanoCpus": 0,
"CgroupParent": "",
"BlkioWeight": 0,
"BlkioWeightDevice": null,
"BlkioDeviceReadBps": null,
"BlkioDeviceWriteBps": null,
"BlkioDeviceReadIOps": null,
"BlkioDeviceWriteIOps": null,
"CpuPeriod": 0,
"CpuQuota": 0,
"CpuRealtimePeriod": 0,
"CpuRealtimeRuntime": 0,
"CpusetCpus": "",
"CpusetMems": "",
"Devices": null,
"DeviceCgroupRules": null,
"DeviceRequests": null,
"MemoryReservation": 0,
"MemorySwap": 0,
"MemorySwappiness": null,
"OomKillDisable": false,
"PidsLimit": null,
"Ulimits": [],
"CpuCount": 0,
"CpuPercent": 0,
"IOMaximumIOps": 0,
"IOMaximumBandwidth": 0,
"Mounts": [
{
"Type": "volume",
"Source": "caddy_data",
"Target": "/data",
"VolumeOptions": {}
},
{
"Type": "volume",
"Source": "myapp_caddy_config",
"Target": "/config",
"VolumeOptions": {
"Labels": {
"com.docker.stack.namespace": "myapp"
}
}
}
],
"MaskedPaths": [
"/proc/asound",
"/proc/acpi",
"/proc/kcore",
"/proc/keys",
"/proc/latency_stats",
"/proc/timer_list",
"/proc/timer_stats",
"/proc/sched_debug",
"/proc/scsi",
"/sys/firmware",
"/sys/devices/virtual/powercap"
],
"ReadonlyPaths": [
"/proc/bus",
"/proc/fs",
"/proc/irq",
"/proc/sys",
"/proc/sysrq-trigger"
]
},
"GraphDriver": {
"Data": {
"LowerDir": "/var/lib/docker/overlay2/600bb3ff373442d271efbd993fc5322ce874fceba5316257134a986a7f5b4394-init/diff:/var/lib/docker/overlay2/cg51n9oz7td40nwl2qrt6jywg/diff:/var/lib/docker/overlay2/5eb75a4c14e8faae24427a3230e69336fc39187ec7d3afe36f836cd5e4a4b06d/diff:/var/lib/docker/overlay2/0f7dd5a42fe66eb24a48b0b1b356d7355785b45056b31873b64693915c1d7431/diff:/var/lib/docker/overlay2/b4b534fe46378113da0e1aa0b3ca73f02464e29560a5455fa381cd77ad434a06/diff:/var/lib/docker/overlay2/b499d33e3f810b6e035cae3e95a433736e974541cea28b7b942bbcf529645d4e/diff",
"MergedDir": "/var/lib/docker/overlay2/600bb3ff373442d271efbd993fc5322ce874fceba5316257134a986a7f5b4394/merged",
"UpperDir": "/var/lib/docker/overlay2/600bb3ff373442d271efbd993fc5322ce874fceba5316257134a986a7f5b4394/diff",
"WorkDir": "/var/lib/docker/overlay2/600bb3ff373442d271efbd993fc5322ce874fceba5316257134a986a7f5b4394/work"
},
"Name": "overlay2"
},
"Mounts": [
{
"Type": "volume",
"Name": "caddy_data",
"Source": "/var/lib/docker/volumes/caddy_data/_data",
"Destination": "/data",
"Driver": "local",
"Mode": "z",
"RW": true,
"Propagation": ""
},
{
"Type": "volume",
"Name": "myapp_caddy_config",
"Source": "/var/lib/docker/volumes/myapp_caddy_config/_data",
"Destination": "/config",
"Driver": "local",
"Mode": "z",
"RW": true,
"Propagation": ""
}
],
"Config": {
"Hostname": "aa6b4201e4f2",
"Domainname": "",
"User": "",
"AttachStdin": false,
"AttachStdout": false,
"AttachStderr": false,
"ExposedPorts": {
"2019/tcp": {},
"443/tcp": {},
"443/udp": {},
"80/tcp": {}
},
"Tty": false,
"OpenStdin": false,
"StdinOnce": false,
"Env": [
"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
"CADDY_VERSION=v2.7.6",
"XDG_CONFIG_HOME=/config",
"XDG_DATA_HOME=/data"
],
"Cmd": [
"caddy",
"run",
"--config",
"/etc/caddy/Caddyfile",
"--adapter",
"caddyfile"
],
"Image": "andrewwang1tw/micro-caddy:0.0.0.0.7788@sha256:eeb48ca0b73dc789253022e0177118926912ef9e8382e993120dd4ff8da3e53a",
"Volumes": null,
"WorkingDir": "/srv",
"Entrypoint": null,
"OnBuild": null,
"Labels": {
"com.docker.stack.namespace": "myapp",
"com.docker.swarm.node.id": "psa9fb7qsse5swtni5yjwqli9",
"com.docker.swarm.service.id": "k7os1ism4o3cvntqg8pq151xn",
"com.docker.swarm.service.name": "myapp_caddy",
"com.docker.swarm.task": "",
"com.docker.swarm.task.id": "rdbxu8iy62gv8erzmov5eif6s",
"com.docker.swarm.task.name": "myapp_caddy.1.rdbxu8iy62gv8erzmov5eif6s",
"org.opencontainers.image.description": "a powerful, enterprise-ready, open source web server with automatic HTTPS written in Go",
"org.opencontainers.image.documentation": "https://caddyserver.com/docs",
"org.opencontainers.image.licenses": "Apache-2.0",
"org.opencontainers.image.source": "https://github.com/caddyserver/caddy-docker",
"org.opencontainers.image.title": "Caddy",
"org.opencontainers.image.url": "https://caddyserver.com",
"org.opencontainers.image.vendor": "Light Code Labs",
"org.opencontainers.image.version": "v2.7.6"
}
},
"NetworkSettings": {
"Bridge": "",
"SandboxID": "85a958d4cb1567d4886e1e5b9475fd4e36d2b1d8f1dc115cac92b5726748aa6b",
"SandboxKey": "/var/run/docker/netns/85a958d4cb15",
"Ports": {
"2019/tcp": null,
"443/tcp": null,
"443/udp": null,
"80/tcp": null
},
"HairpinMode": false,
"LinkLocalIPv6Address": "",
"LinkLocalIPv6PrefixLen": 0,
"SecondaryIPAddresses": null,
"SecondaryIPv6Addresses": null,
"EndpointID": "",
"Gateway": "",
"GlobalIPv6Address": "",
"GlobalIPv6PrefixLen": 0,
"IPAddress": "",
"IPPrefixLen": 0,
"IPv6Gateway": "",
"MacAddress": "",
"Networks": {
"ingress": {
"IPAMConfig": {
"IPv4Address": "10.0.0.4"
},
"Links": null,
"Aliases": [
"aa6b4201e4f2"
],
"MacAddress": "02:42:0a:00:00:04",
"NetworkID": "r2chth8ookv7rlsebmv0plfqe",
"EndpointID": "4f4c695fcf9517df90e68ec134f69e3f80c28afbaa89b289f3d7b870653399d0",
"Gateway": "",
"IPAddress": "10.0.0.4",
"IPPrefixLen": 24,
"IPv6Gateway": "",
"GlobalIPv6Address": "",
"GlobalIPv6PrefixLen": 0,
"DriverOpts": null,
"DNSNames": [
"myapp_caddy.1.rdbxu8iy62gv8erzmov5eif6s",
"aa6b4201e4f2"
]
},
"myapp_default": {
"IPAMConfig": {
"IPv4Address": "10.0.1.3"
},
"Links": null,
"Aliases": [
"aa6b4201e4f2"
],
"MacAddress": "02:42:0a:00:01:03",
"NetworkID": "oshbke93xghlfn9scw1kxqzji",
"EndpointID": "9454702333a26352cb90f55396d0ae503adf3426acd1162827f3087965510dbe",
"Gateway": "",
"IPAddress": "10.0.1.3",
"IPPrefixLen": 24,
"IPv6Gateway": "",
"GlobalIPv6Address": "",
"GlobalIPv6PrefixLen": 0,
"DriverOpts": null,
"DNSNames": [
"myapp_caddy.1.rdbxu8iy62gv8erzmov5eif6s",
"aa6b4201e4f2"
]
}
}
}
}
]
PS C:\ProgramData\chocolatey\lib\curl\tools\curl-8.6.0_1-win64-mingw\bin>