Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/xtuc/curltainer
curl anything running inside a Docker container, even with no exposed ports
https://github.com/xtuc/curltainer
curl docker namespace network
Last synced: about 1 month ago
JSON representation
curl anything running inside a Docker container, even with no exposed ports
- Host: GitHub
- URL: https://github.com/xtuc/curltainer
- Owner: xtuc
- Created: 2024-11-23T20:17:55.000Z (about 1 month ago)
- Default Branch: main
- Last Pushed: 2024-11-23T20:29:56.000Z (about 1 month ago)
- Last Synced: 2024-11-23T21:20:42.024Z (about 1 month ago)
- Topics: curl, docker, namespace, network
- Language: Rust
- Homepage:
- Size: 10.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# curltainer
> curl anything running inside a Docker container, even with no exposed ports
## Install
```
cargo install curltainer
```## Usage
```
Usage: curltainer --container-name [CURL_ARGS]...Arguments:
[CURL_ARGS]...Options:
-c, --container-name
-h, --help Print help
-V, --version Print version```
## How it works?
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
<...
```