docker-nixpkgs/docker-login
Jonas Chevalier bf1338907c
ci: add GitHub Actions cron (#16)
* ci: add dependabot

* ci: revamp logic

Merge username and password as a single auth token. It doesn't make
sense to split out the user and password since they are so tied
together. Might as well treat the whole think as a secret blob.

Remove Travis-CI. Travis is dead for OSS.

Add GitHub Actions cron. Remove cachix as it's pushing too much stuff.

Merge all of the CI logic into a single ci.sh script.
2021-02-10 13:25:01 +01:00

27 lines
553 B
Bash
Executable file

#!/usr/bin/env bash
#
# A simplified docker login approach that doesn't depends on the docker binary
#
# Usage: ./docker-login <username> <password> [registry]
set -euo pipefail
auth=$1
registry=${2:-docker.io}
# Encode some funky docker heuristic
if [[ $registry = *docker.io ]]; then
# use the v2 registry so that skopeo can do noop layer copies
registry=https://index.docker.io/v2/
fi
mkdir ~/.docker
cat <<DOCKER_CONF > ~/.docker/config.json
{
"auths": {
"$registry": {
"auth": "$(echo "$auth" | base64)"
}
}
}
DOCKER_CONF