Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

minor container related amends #452

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
22 changes: 22 additions & 0 deletions build/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,28 @@ common methods are probably building with Microsoft's Visual Studio compiler
using either `nmake` or project files. See the build on
[windows](windows.md) section.

## Building curl and libcurl using dev containers

A set of curl development containers are built daily, providing the following environments:
* [curl-dev](https://github.com/curl/curl-container/pkgs/container/curl-container%2Fcurl-dev): alpine based development container
* [curl-dev-debian](https://github.com/curl/curl-container/pkgs/container/curl-container%2Fcurl-dev-debian): debian based development container
* [curl-dev-fedora](https://github.com/curl/curl-container/pkgs/container/curl-container%2Fcurl-dev-fedora): fedora based development container

To setup up an _instant_ development environment:
```
> podman run -it -v /home/exampleuser/src/curl:/src/curl ghcr.io/curl/curl-container/curl-dev-debian:master zsh
```

Which uses `-v` to mount a local git checkout of curl though the container also comes embedded with the latest master branch
source code (`/src/curl-master`).

Then just build as normal:
```
> autoreconf -fi
> ./configure --with-openssl
> make
```

## Learn more

* [Autotools](autotools.md) - build with configure
Expand Down
39 changes: 27 additions & 12 deletions install/container.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,22 @@
# 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)
Both `docker` and `podman` are containerization tools. The official release container images
are hosted at the following registries:
* [https://quay.io/repository/curl/curl?tab=info](https://quay.io/repository/curl/curl?tab=info)
* [https://hub.docker.com/r/curlimages/curl](https://hub.docker.com/r/curlimages/curl)

In addition, the the latest _bleeding edge_ containers, built by CI, are pushed constantly
to [https://github.com/orgs/curl/packages](https://github.com/orgs/curl/packages).

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

Command for `docker`:
Command for `podman`:

docker run -it --rm docker.io/curlimages/curl www.example.com
podman run -it --rm quay.io/curl/curl www.example.com

Command for `podman`:
Command for `docker`:

podman run -it --rm docker.io/curlimages/curl www.example.com
docker run -it --rm quay.io/curl/curl www.example.com

## Running curl seamlessly in container

Expand All @@ -26,28 +30,39 @@ ZSH, Fish shell:

Invoke curl with `docker`:

alias curl='docker run -it --rm docker.io/curlimages/curl'
alias curl='docker run -it --rm quay.io/curl/curl'

Invoke curl with `podman`:

alias curl='podman run -it --rm docker.io/curlimages/curl'
alias curl='podman run -it --rm quay.io/curl/curl'

### Fish

Invoke curl with `docker`:

alias -s curl='docker run -it --rm docker.io/curlimages/curl'
alias -s curl='docker run -it --rm quay.io/curl/curl'

Invoke curl with `podman`:

alias -s curl='podman run -it --rm docker.io/curlimages/curl'
alias -s curl='podman run -it --rm quay.io/curl/curl'

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

## Using curl-base image

The **curl-base** image should be used when one wants to create an image at [https://quay.io/repository/curl/curl-base?tab=info](https://quay.io/repository/curl/curl-base)

For example:
```
from quay.io/curl/curl-base
RUN apk add jq
```


## 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 \
kubectl run -i --tty curl --image=quay.io/curl/curl --restart=Never \
-- "-m 5" www.example.com