Crates.io | curltainer |
lib.rs | curltainer |
version | 1.0.1 |
source | src |
created_at | 2024-11-23 20:20:18.417992 |
updated_at | 2024-11-23 20:30:13.895763 |
description | curl anything running inside a Docker container, even with no exposed ports |
homepage | |
repository | https://github.com/xtuc/curltainer |
max_upload_size | |
id | 1458675 |
size | 40,852 |
curl anything running inside a Docker container, even with no exposed ports
cargo install curltainer
Usage: curltainer --container-name <CONTAINER_NAME> [CURL_ARGS]...
Arguments:
[CURL_ARGS]...
Options:
-c, --container-name <CONTAINER_NAME>
-h, --help Print help
-V, --version Print version
Start a Docker container with a HTTP server, with no ports exposed to the host:
$ docker run -d python python -m http.server 9000
a8c8e9...
curl the server running inside the container from the host:
$ sudo curltainer -c a8c8e9... localhost:9000 -v
* Trying 127.0.0.1:9000...
* Connected to localhost (127.0.0.1) port 9000 (#0)
> GET / HTTP/1.1
> Host: localhost:9000
> User-Agent: curl/7.81.0
> Accept: */*
>
* Mark bundle as not supporting multiuse
* HTTP 1.0, assume close after body
< HTTP/1.0 200 OK
< Server: SimpleHTTP/0.6 Python/3.13.0
< Date: Sat, 23 Nov 2024 20:16:00 GMT
< Content-type: text/html; charset=utf-8
< Content-Length: 877
<
<!DOCTYPE HTML>
<html lang="en">
...