generate the DockerHub image matrix

This commit is contained in:
zimbatm 2019-02-15 14:30:37 +01:00
parent e9633d0d58
commit 8cbbfe7009
No known key found for this signature in database
GPG key ID: 71BAF6D40C1D63D7
6 changed files with 73 additions and 5 deletions

View file

@ -19,7 +19,7 @@ if [[ "$CI_COMMIT_REF_NAME" = master ]]; then
./docker-login "$REGISTRY_USER" "$REGISTRY_PASSWORD" "$REGISTRY"
./push-all "$REGISTRY" "$IMAGE_PREFIX" "$IMAGE_TAG"
if [[ $REGISTRY = *docker.io ]]; then
./update-docker-hub "$REGISTRY_USER" "$REGISTRY_PASSWORD" "$IMAGE_PREFIX"
./dockerhub-metadata "$REGISTRY_USER" "$REGISTRY_PASSWORD" "$IMAGE_PREFIX"
fi
else
echo "=== not pushing on non-master ==="

View file

@ -18,7 +18,7 @@ if [[ "$TRAVIS_BRANCH" = master && -z "$TRAVIS_PULL_REQUEST_BRANCH" ]]; then
./docker-login "$REGISTRY_USER" "$REGISTRY_PASSWORD" "$REGISTRY"
./push-all "$REGISTRY" "$IMAGE_PREFIX" "$IMAGE_TAG"
if [[ $REGISTRY = *docker.io ]]; then
./update-dockerhub "$REGISTRY_USER" "$REGISTRY_PASSWORD" "$IMAGE_PREFIX"
./dockerhub-metadata "$REGISTRY_USER" "$REGISTRY_PASSWORD" "$IMAGE_PREFIX"
fi
else
echo "=== not pushing on non-master ==="

View file

@ -31,8 +31,8 @@ $ docker run -ti --rm nixpkgs/curl curl http://ifconfig.co
## List of images
Here is the current list of images that are provided. Missing one?
[Submit a request](https://github.com/nix-community/docker-nixpkgs/issues/new)
Here is the current list of images that are provided. Missing one? Send an
[image request](#image-request).
| Image | Description |
| --- | --- |
@ -58,12 +58,49 @@ nixpkgs channel describes.
| nixos-unstable | latest | latest and greated, major versions might change |
| nixos-18.09 | nixos-18.09 | only minor versions that include security updates |
## Docker Hub
All images are automatically built and pushed to Docker Hub.
### Image matrix
`> ./dockerhub-image-matrix`
| Image / Tag | latest | nixos-18.09 |
| --- | --- | --- |
| [nixpkgs/bash](https://hub.docker.com/r/nixpkgs/bash) | ![](https://images.microbadger.com/badges/image/nixpkgs/bash.svg) | ![](https://images.microbadger.com/badges/image/nixpkgs/bash:nixos-18.09.svg) |
| [nixpkgs/busybox](https://hub.docker.com/r/nixpkgs/busybox) | ![](https://images.microbadger.com/badges/image/nixpkgs/busybox.svg) | ![](https://images.microbadger.com/badges/image/nixpkgs/busybox:nixos-18.09.svg) |
| [nixpkgs/curl](https://hub.docker.com/r/nixpkgs/curl) | ![](https://images.microbadger.com/badges/image/nixpkgs/curl.svg) | ![](https://images.microbadger.com/badges/image/nixpkgs/curl:nixos-18.09.svg) |
| [nixpkgs/docker-compose](https://hub.docker.com/r/nixpkgs/docker-compose) | ![](https://images.microbadger.com/badges/image/nixpkgs/docker-compose.svg) | ![](https://images.microbadger.com/badges/image/nixpkgs/docker-compose:nixos-18.09.svg) |
| [nixpkgs/kubectl](https://hub.docker.com/r/nixpkgs/kubectl) | ![](https://images.microbadger.com/badges/image/nixpkgs/kubectl.svg) | ![](https://images.microbadger.com/badges/image/nixpkgs/kubectl:nixos-18.09.svg) |
| [nixpkgs/kubernetes-helm](https://hub.docker.com/r/nixpkgs/kubernetes-helm) | ![](https://images.microbadger.com/badges/image/nixpkgs/kubernetes-helm.svg) | ![](https://images.microbadger.com/badges/image/nixpkgs/kubernetes-helm:nixos-18.09.svg) |
| [nixpkgs/nix](https://hub.docker.com/r/nixpkgs/nix) | ![](https://images.microbadger.com/badges/image/nixpkgs/nix.svg) | ![](https://images.microbadger.com/badges/image/nixpkgs/nix:nixos-18.09.svg) |
| [nixpkgs/nix-unstable](https://hub.docker.com/r/nixpkgs/nix-unstable) | ![](https://images.microbadger.com/badges/image/nixpkgs/nix-unstable.svg) | ![](https://images.microbadger.com/badges/image/nixpkgs/nix-unstable:nixos-18.09.svg) |
## Related projects
The [docker-library](https://github.com/docker-library/official-images#readme)
is an image set maintained by the Docker Inc. team and contain
officially-supported images.
## User Feedback
### Issues
If you have any problems with or questions about this project, please contact
us through a [GitHub issue](https://github.com/nix-community/docker-nixpkgs/issues/new)
### Image request
[Submit a request](https://github.com/nix-community/docker-nixpkgs/issues/new)
with an accompanying use-case for an image that you would like to see.
### Contributing
You are invited to contribute new features, fixes or updates, large or small;
we are always thrilled to receive pull requests, and do our brest ot process
them as fast as we can.
## License
Copyright (c) 2019 zimbatm and contributors.

30
dockerhub-image-matrix Executable file
View file

@ -0,0 +1,30 @@
#!/usr/bin/env bash
#
# Usage: ./dockerhub-image-matrix
set -euo pipefail
microbadge() {
local name=$1
local tag=${2:-latest}
if [[ $tag != latest ]]; then
name=$name:$tag
fi
# make sure that microbadger has loaded the image
curl -o /dev/null -sfL "https://microbadger.com/images/$name"
echo "![](https://images.microbadger.com/badges/image/$name.svg)"
}
## Main ##
releases_json=$(nix-instantiate ./release.nix --strict --eval --json)
echo "| Image / Tag | latest | nixos-18.09 |"
echo "| --- | --- | --- |"
for attr in $(echo "$releases_json" | jq -r "keys[]") ; do
name=nixpkgs/$attr
echo "| [$name](https://hub.docker.com/r/$name) | $(microbadge "$name") | $(microbadge "$name" "nixos-18.09") |"
done

View file

@ -3,7 +3,7 @@
# Update docker hub image descriptions. The API is not documented and might
# break in the future.
#
# Usage: ./update-dockerhub <user> <password> [org]
# Usage: ./dockerhub-metadata <user> <password> [org]
set -euo pipefail
username=$1

View file

@ -24,6 +24,7 @@ dockerTools.buildLayeredImage {
"SSL_CERT_FILE=${cacert}/etc/ssl/certs/ca-bundle.crt"
];
Labels = {
# https://github.com/microscaling/microscaling/blob/55a2d7b91ce7513e07f8b1fd91bbed8df59aed5a/Dockerfile#L22-L33
"org.label-schema.vcs-ref" = "master";
"org.label-schema.vcs-url" = "https://github.com/nix-community/docker-nixpkgs";
};