Update README.md
This commit is contained in:
parent
7d8c939758
commit
f376feda30
1 changed files with 3 additions and 33 deletions
36
README.md
36
README.md
|
@ -61,40 +61,10 @@ htpasswd -bnB MyUsername MyPassword > ./htpasswd
|
||||||
## Usage
|
## Usage
|
||||||
### Building Docker Image
|
### 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.
|
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:
|
To build and push a Docker image to your Zot registry, I recommend using the Buildah command line tool.
|
||||||
```
|
|
||||||
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`.
|
|
||||||
|
|
||||||
Run `docker save` to convert the existing image to a `.tar` format:
|
Learn how to here: https://gist.sudovanilla.org/Korbs/buildah-build-and-push
|
||||||
```bash
|
|
||||||
docker save -o your-image.tar your-image
|
|
||||||
```
|
|
||||||
|
|
||||||
Then, push it to your Zot registry:
|
> Don't use Skopeo, as it doesn't carry over the `cmd` or `entrypoint` of the Docker image.
|
||||||
```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
|
|
||||||
```
|
|
Loading…
Reference in a new issue