Update README.md

This commit is contained in:
Korbs 2024-12-11 12:27:10 -05:00
parent 7d8c939758
commit f376feda30

View file

@ -61,40 +61,10 @@ htpasswd -bnB MyUsername MyPassword > ./htpasswd
## Usage
### Building Docker Image
You can build a Docker image as you normally would.
```bash
docker build -t your-image .
```
### Pushing Docker Image
Zot seems to be setup to accept OCI images, not the Docker format, so using `docker push` won't work. You can use `skopeo` to push, after you save the Docker image as a tar.
Before we proceed, make to login into your Zot registry:
```
skopeo login zot.whatever.org
```
> If you used OpenID Connect to create an account. Use your email as the `username` and crete an API Token as the `password`.
To build and push a Docker image to your Zot registry, I recommend using the Buildah command line tool.
Run `docker save` to convert the existing image to a `.tar` format:
```bash
docker save -o your-image.tar your-image
```
Learn how to here: https://gist.sudovanilla.org/Korbs/buildah-build-and-push
Then, push it to your Zot registry:
```bash
skopeo copy tarball:./your-image.tar docker://zot.whatever.org/your-image
```
The `/your-image` part in the `skopeo copy` command can be whatever. `/whatever/your-image` also works.
**Try it Out**
Let's try pushing an existing image from Docker Hub to your Zot registry, we'll use Bun's image in this example.
```bash
docker pull oven/bun
docker save -o bun.tar oven/bun
skopeo copy tarball:./bun.tar docker://zot.whatever.org/oven/bun
```
> Don't use Skopeo, as it doesn't carry over the `cmd` or `entrypoint` of the Docker image.