Docker Image Uploader
This project provides a straightforward guide to download an image via Docker Desktop and upload it to GitLab’s Container Registry using command-line instructions. Ensure Docker is running and that your GitLab account has access to the registry.
Prerequisites
- Docker Desktop: Ensure Docker is installed and running.
- GitLab Access: You should have credentials for GitLab. If using two-factor authentication (2FA), use a personal access token instead of a password.
Steps
1. Authenticate to the GitLab Container Registry
To push images to GitLab, log in to the Container Registry:
docker login gitlab.rc.uab.edu:4567
If you use 2FA, replace your password with a personal access token.
2. Download or Pull an Image (Optional)
If you want to download an existing image from Docker Hub or another registry, use:
docker pull <image_name>:<tag>
Replace <image_name>: with the actual image name and tag you need.
3. Tag the Image for GitLab Registry
To prepare the image for upload to GitLab’s registry, assign it a tag in the following format:
docker tag <local_image_name>:<tag> gitlab.rc.uab.edu:4567/<your_gitlab_namespace>/<project_name>:<tag>
Replace:
<local_image_name> and with the local image name and tag. <your_gitlab_namespace>/<project_name> with your actual GitLab project path.
4. Push the Image to GitLab’s Container Registry
Upload the image with the docker push command:
docker push gitlab.rc.uab.edu:4567/<your_gitlab_namespace>/<project_name>:<tag>