generate the DockerHub image matrix
This commit is contained in:
parent
e9633d0d58
commit
8cbbfe7009
6 changed files with 73 additions and 5 deletions
|
@ -19,7 +19,7 @@ if [[ "$CI_COMMIT_REF_NAME" = master ]]; then
|
||||||
./docker-login "$REGISTRY_USER" "$REGISTRY_PASSWORD" "$REGISTRY"
|
./docker-login "$REGISTRY_USER" "$REGISTRY_PASSWORD" "$REGISTRY"
|
||||||
./push-all "$REGISTRY" "$IMAGE_PREFIX" "$IMAGE_TAG"
|
./push-all "$REGISTRY" "$IMAGE_PREFIX" "$IMAGE_TAG"
|
||||||
if [[ $REGISTRY = *docker.io ]]; then
|
if [[ $REGISTRY = *docker.io ]]; then
|
||||||
./update-docker-hub "$REGISTRY_USER" "$REGISTRY_PASSWORD" "$IMAGE_PREFIX"
|
./dockerhub-metadata "$REGISTRY_USER" "$REGISTRY_PASSWORD" "$IMAGE_PREFIX"
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
echo "=== not pushing on non-master ==="
|
echo "=== not pushing on non-master ==="
|
||||||
|
|
|
@ -18,7 +18,7 @@ if [[ "$TRAVIS_BRANCH" = master && -z "$TRAVIS_PULL_REQUEST_BRANCH" ]]; then
|
||||||
./docker-login "$REGISTRY_USER" "$REGISTRY_PASSWORD" "$REGISTRY"
|
./docker-login "$REGISTRY_USER" "$REGISTRY_PASSWORD" "$REGISTRY"
|
||||||
./push-all "$REGISTRY" "$IMAGE_PREFIX" "$IMAGE_TAG"
|
./push-all "$REGISTRY" "$IMAGE_PREFIX" "$IMAGE_TAG"
|
||||||
if [[ $REGISTRY = *docker.io ]]; then
|
if [[ $REGISTRY = *docker.io ]]; then
|
||||||
./update-dockerhub "$REGISTRY_USER" "$REGISTRY_PASSWORD" "$IMAGE_PREFIX"
|
./dockerhub-metadata "$REGISTRY_USER" "$REGISTRY_PASSWORD" "$IMAGE_PREFIX"
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
echo "=== not pushing on non-master ==="
|
echo "=== not pushing on non-master ==="
|
||||||
|
|
41
README.md
41
README.md
|
@ -31,8 +31,8 @@ $ docker run -ti --rm nixpkgs/curl curl http://ifconfig.co
|
||||||
|
|
||||||
## List of images
|
## List of images
|
||||||
|
|
||||||
Here is the current list of images that are provided. Missing one?
|
Here is the current list of images that are provided. Missing one? Send an
|
||||||
[Submit a request](https://github.com/nix-community/docker-nixpkgs/issues/new)
|
[image request](#image-request).
|
||||||
|
|
||||||
| Image | Description |
|
| Image | Description |
|
||||||
| --- | --- |
|
| --- | --- |
|
||||||
|
@ -58,12 +58,49 @@ nixpkgs channel describes.
|
||||||
| nixos-unstable | latest | latest and greated, major versions might change |
|
| nixos-unstable | latest | latest and greated, major versions might change |
|
||||||
| nixos-18.09 | nixos-18.09 | only minor versions that include security updates |
|
| 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) |  |  |
|
||||||
|
| [nixpkgs/busybox](https://hub.docker.com/r/nixpkgs/busybox) |  |  |
|
||||||
|
| [nixpkgs/curl](https://hub.docker.com/r/nixpkgs/curl) |  |  |
|
||||||
|
| [nixpkgs/docker-compose](https://hub.docker.com/r/nixpkgs/docker-compose) |  |  |
|
||||||
|
| [nixpkgs/kubectl](https://hub.docker.com/r/nixpkgs/kubectl) |  |  |
|
||||||
|
| [nixpkgs/kubernetes-helm](https://hub.docker.com/r/nixpkgs/kubernetes-helm) |  |  |
|
||||||
|
| [nixpkgs/nix](https://hub.docker.com/r/nixpkgs/nix) |  |  |
|
||||||
|
| [nixpkgs/nix-unstable](https://hub.docker.com/r/nixpkgs/nix-unstable) |  |  |
|
||||||
|
|
||||||
## Related projects
|
## Related projects
|
||||||
|
|
||||||
The [docker-library](https://github.com/docker-library/official-images#readme)
|
The [docker-library](https://github.com/docker-library/official-images#readme)
|
||||||
is an image set maintained by the Docker Inc. team and contain
|
is an image set maintained by the Docker Inc. team and contain
|
||||||
officially-supported images.
|
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
|
## License
|
||||||
|
|
||||||
Copyright (c) 2019 zimbatm and contributors.
|
Copyright (c) 2019 zimbatm and contributors.
|
||||||
|
|
30
dockerhub-image-matrix
Executable file
30
dockerhub-image-matrix
Executable 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 ""
|
||||||
|
}
|
||||||
|
|
||||||
|
## 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
|
|
@ -3,7 +3,7 @@
|
||||||
# Update docker hub image descriptions. The API is not documented and might
|
# Update docker hub image descriptions. The API is not documented and might
|
||||||
# break in the future.
|
# break in the future.
|
||||||
#
|
#
|
||||||
# Usage: ./update-dockerhub <user> <password> [org]
|
# Usage: ./dockerhub-metadata <user> <password> [org]
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
username=$1
|
username=$1
|
|
@ -24,6 +24,7 @@ dockerTools.buildLayeredImage {
|
||||||
"SSL_CERT_FILE=${cacert}/etc/ssl/certs/ca-bundle.crt"
|
"SSL_CERT_FILE=${cacert}/etc/ssl/certs/ca-bundle.crt"
|
||||||
];
|
];
|
||||||
Labels = {
|
Labels = {
|
||||||
|
# https://github.com/microscaling/microscaling/blob/55a2d7b91ce7513e07f8b1fd91bbed8df59aed5a/Dockerfile#L22-L33
|
||||||
"org.label-schema.vcs-ref" = "master";
|
"org.label-schema.vcs-ref" = "master";
|
||||||
"org.label-schema.vcs-url" = "https://github.com/nix-community/docker-nixpkgs";
|
"org.label-schema.vcs-url" = "https://github.com/nix-community/docker-nixpkgs";
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue