-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update readme and add check if images already exist
- Loading branch information
1 parent
faa6dad
commit e59a1d9
Showing
2 changed files
with
15 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,10 @@ | ||
# Docker Official Images | ||
|
||
We are moving away from Docker Hub to GitHub Container Registry because of rate limiting issues. There may be certain images however, that officially available on Docker Hub so this is a small script to port those images to GHCR. You can then pull them using: | ||
We are moving away from Docker Hub to GitHub Container Registry because of rate limiting issues. | ||
|
||
There may be certain images however, that are officially available on Docker Hub so this is a small script to port those images to GHCR. You can add more images [here](./port-images-to-ghcr). | ||
|
||
You can then pull them using: | ||
```bash | ||
docker pull ghcr.io/mrc-ide/docker-official-images/<image-name>:<tag> | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,22 @@ | ||
#!/usr/bin/env bash | ||
set -ex | ||
|
||
# add more images here | ||
declare -a docker_images=( | ||
"redis:6" | ||
"redis:5" | ||
) | ||
|
||
for image in "${docker_images[@]}" | ||
do | ||
docker pull "$image" | ||
docker image tag "$image" ghcr.io/mrc-ide/docker-official-images/"$image" | ||
docker image push ghcr.io/mrc-ide/docker-official-images/"$image" | ||
docker manifest inspect ghcr.io/mrc-ide/docker-official-images/"$image" > /dev/null 2>&1 | ||
exit_code=$? | ||
|
||
if [ $exit_code -eq 0 ]; then | ||
echo "Not porting over $image because it already exists in the GHCR" | ||
else | ||
docker pull "$image" | ||
docker image tag "$image" ghcr.io/mrc-ide/docker-official-images/"$image" | ||
docker image push ghcr.io/mrc-ide/docker-official-images/"$image" | ||
fi | ||
done |