Merge pull request #4301 from black-river-software/black-river-software/push-docker-image-with-docker

build: docker-image: Use docker instead of Skopeo to push
This commit is contained in:
Jared Tobin 2021-01-19 19:54:31 +04:00 committed by GitHub
commit 78bb765847
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -40,8 +40,12 @@ jobs:
- run: |
version="$(cat ./pkg/urbit/version)"
skopeo="$(nix-build -A skopeo)/bin/skopeo"
image="$(nix-build -A docker-image)"
$skopeo --insecure-policy copy tarball:$docker docker://${{ secrets.DOCKERHUB_USERNAME }}/urbit:v$version
# Apply 'latest' tag. This won't re-copy any layers since layers are checked by hash before copying
$skopeo --insecure-policy copy tarball:$docker docker://${{ secrets.DOCKERHUB_USERNAME }}/urbit:latest
imageName="$(nix-instantiate --eval -A docker-image.imageName | cut -d'"' -f2)"
imageTag="$(nix-instantiate --eval -A docker-image.imageTag | cut -d'"' -f2)"
# Load the image from the nix-built tarball
docker load -i $image
docker tag "$imageName:$imageTag" ${{secrets.DOCKERHUB_USERNAME }}/urbit:v$version
docker tag "$imageName:$imageTag" ${{secrets.DOCKERHUB_USERNAME }}/urbit:latest
docker push ${{secrets.DOCKERHUB_USERNAME }}/urbit:v$version
docker push ${{secrets.DOCKERHUB_USERNAME }}/urbit:latest