Skip to content

Commit

Permalink
get/container: renamed from docker, used for more container speak
Browse files Browse the repository at this point in the history
Closes #366
  • Loading branch information
Man2Dev authored and bagder committed Dec 21, 2023
1 parent 378e1a3 commit 539b6b5
Show file tree
Hide file tree
Showing 6 changed files with 87 additions and 30 deletions.
2 changes: 1 addition & 1 deletion SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
* [MSYS2](get/win-msys2.md)
* [vcpkg](get/win-vcpkg.md)
* [macOS](get/macos.md)
* [Docker](get/docker.md)
* [Container](get/container.md)
* [Source code](source.md)
* [Open Source](source/opensource.md)
* [License](source/opensource/license.md)
Expand Down
2 changes: 1 addition & 1 deletion get.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ there.
* [Linux](get/linux.md)
* [Windows](get/windows.md)
* [macOS](get/macos.md)
* [Docker](get/docker.md)
* [Container](get/container.md)
70 changes: 70 additions & 0 deletions get/container.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# Container

Both `Docker` and, `Podman` are containerization tools.
The docker image is hosted at [https://hub.docker.com/r/curlimages/curl](https://hub.docker.com/r/curlimages/curl)

You can run the latest version of curl with the following command:

Command for `Docker`:
```
docker run -it --rm docker.io/curlimages/curl www.example.com
```

Command for `Podman`:
```
podman run -it --rm docker.io/curlimages/curl www.example.com
```

## Running curl seamlessly in container

It is possible to make an alias to seamlessly run curl inside a container.
Define an alias for your Bash (ZSH, Fish, ...) shell shell:

### Bash
(most distributions use bash)

`Docker`
```
echo "alias curl='docker run -it --rm curlimages/curl'" >> ~/.bashrc
```

`Podman`
```
echo "alias curl='podman run -it --rm curlimages/curl'" >> ~/.bashrc
```
Then close your terminal and, reopen it again.

### ZSH
(this is the shell used by MacOS by default)
`Docker`
```
echo "alias curl='docker run -it --rm curlimages/curl'" >> ~/.zshrc
```

`Podman`
```
echo "alias curl='podman run -it --rm curlimages/curl'" >> ~/.zshrc
```
Then close your terminal and, reopen it again.

### Fish
`Docker`
```
alias -s curl='docker run -it --rm curlimages/curl'
```

`Podman`
```
alias -s curl='podman run -it --rm curlimages/curl'
```
Then close your terminal and, reopen it again.

And simply invoke `curl www.example.com` to make a request

## Running curl in kubernetes

Sometimes it can be useful to troubleshoot k8s networking with curl, just like :

```
kubectl run -i --tty curl --image=curlimages/curl --restart=Never -- "-m 5" www.example.com
```
28 changes: 0 additions & 28 deletions get/docker.md

This file was deleted.

12 changes: 12 additions & 0 deletions get/linux.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,18 @@ To install the libcurl development package you run:

dnf install libcurl-devel

## Immutable Fedora distributions

Distributions such as, Silverblue, Kinoite, Sericea, Onyx, ...
use `rpm-ostree` to install packages.
Remember to restart the system after install.

rpm-ostree install curl

To install the libcurl development package you run:

rpm-ostree install libcurl-devel

## nix

[Nix](https://nixos.org/nix/) is a package manager default to the NixOS
Expand Down
3 changes: 3 additions & 0 deletions wordlist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,7 @@ Kaufmann
keepalive
Keil
Kirei
Kinoite
Knauf
kqueue
Krb
Expand Down Expand Up @@ -439,12 +440,14 @@ SEK
selectable
Serv
setopt
Sericea
SFTP
sftp
sha
singlecwd
Sintonen
sizeof
Silverblue
SLE
slist
sln
Expand Down

0 comments on commit 539b6b5

Please sign in to comment.