If enjoy, please consider buying me a coffee.
httpie running in docker alpine (python3+pip3+alpine+httpie)
Auto-trigger docker build for httpie when new release is announced
This feature was added on June 25th, 2023.
- Versions v3.2.2 and above are built with multi-arch support (
--platform linux/amd64, linux/arm/v7, linux/arm64/v8, linux/arm/v6, linux/ppc64le, linux/s390x). - I only provide support for the
linux/amd64platform since I don't have an environment to test other platforms. If you encounter any issues with other architectures, please submit a pull request to address them. - There will be no difference when using the docker pull and docker run commands with other architectures; you can use them as you normally would. For instance, if you need to pull an image for the ARM architecture (such as the new Mac M1 chip), you can run
docker pull alpine/httpie:3.2.2to directly obtain the image.
The source for this image is available on GitHub: https://github.com/alpine-docker/multi-arch-docker-images/blob/master/httpie/Dockerfile
Docker images are built together:
https://app.circleci.com/pipelines/github/alpine-docker/multi-arch-docker-images
Image list:
https://github.com/alpine-docker/multi-arch-docker-images/tree/master#image-details
https://hub.docker.com/r/alpine/httpie/tags/
$ alias http='docker run -ti --rm alpine/httpie'
$ alias https='docker run -ti --rm --entrypoint=https alpine/httpie'To use and persist a .netrc file:
$ alias http='docker run -ti --rm -v ~/.netrc:/root/.netrc alpine/httpie'
$ alias https='docker run -ti --rm -v ~/.netrc:/root/.netrc --entrypoint=https alpine/httpie'A .netrc file must exist at ~ on the host.
/root/.netrc is used because httpie is run as root in the container, and it
looks to the user's home directory (/root) for the .netrc file.
To use and persist a .httpie configuration
directory:
$ alias http='docker run -ti --rm -v ~/.httpie:/root/.httpie alpine/httpie'
$ alias https='docker run -ti --rm -v ~/.httpie:/root/.httpie --entrypoint=https alpine/httpie'The ~/.httpie directory on the host will be created automatically if it does
not exist already. You will notice a ~/.httpie/config.json is created by
httpie if one did not exist.
This will create a temporary alias. In order to make it persist reboots,
you can append this exact line to your ~/.bashrc (or similar) like this:
$ alias http >> ~/.bashrc
$ alias https >> ~/.bashrcRunning HTTPie is as simple as invoking it like this:
From the official examples:
Hello World:
$ https httpie.io/helloCustom HTTP method, HTTP headers and JSON data:
$ http PUT example.org X-API-Token:123 name=JohnSubmitting forms:
$ http -f POST example.org hello=WorldUpload a file using redirected input:
$ http example.org < file.jsonDownload a file and save it via redirected output:
$ http example.org/file > fileYou can supply any number of HTTPie arguments that will be passed through unmodified.
HTTPie has a fairly extensive documentation available. Also, you can use its included help output:
$ http --help- Enable CI cronjob on this repo to run build regularly on master branch (Weekly)
- Build and push the images with latest version
- Run the latest image locally and get the application version
- Tag the image with the version, from previous step
- push the image with version via tool called crane