diff --git a/.gitlab-ci.sh b/.gitlab-ci.sh index ce09541..dcc3ced 100755 --- a/.gitlab-ci.sh +++ b/.gitlab-ci.sh @@ -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 ===" diff --git a/.travis.sh b/.travis.sh index dca29de..d07cb9c 100755 --- a/.travis.sh +++ b/.travis.sh @@ -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 ===" diff --git a/README.md b/README.md index b0ef7ed..0908de1 100644 --- a/README.md +++ b/README.md @@ -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. diff --git a/dockerhub-image-matrix b/dockerhub-image-matrix new file mode 100755 index 0000000..9357e70 --- /dev/null +++ b/dockerhub-image-matrix @@ -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 diff --git a/update-dockerhub b/dockerhub-metadata similarity index 94% rename from update-dockerhub rename to dockerhub-metadata index f5acfcd..d52dec9 100755 --- a/update-dockerhub +++ b/dockerhub-metadata @@ -3,7 +3,7 @@ # Update docker hub image descriptions. The API is not documented and might # break in the future. # -# Usage: ./update-dockerhub [org] +# Usage: ./dockerhub-metadata [org] set -euo pipefail username=$1 diff --git a/lib/buildCLIImage.nix b/lib/buildCLIImage.nix index 6c3eee4..244b369 100644 --- a/lib/buildCLIImage.nix +++ b/lib/buildCLIImage.nix @@ -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"; };