-
-
Notifications
You must be signed in to change notification settings - Fork 305
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
get/container: renamed from docker, used for more container speak
Closes #366
- Loading branch information
Showing
6 changed files
with
87 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
``` |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters