Skip to content

Commit

Permalink
Move to reference images in our own registry (#3283)
Browse files Browse the repository at this point in the history
Signed-off-by: David Gannon <[email protected]>
Co-authored-by: Kim Christensen <[email protected]>
  • Loading branch information
dgannon991 and kichristensen authored Dec 15, 2024
1 parent 4899aa2 commit d6c04b0
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 26 deletions.
8 changes: 4 additions & 4 deletions docs/content/blog/docker-mixin-blog-post.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Mixins are critical building blocks for bundles, and we hope the Docker mixin wi

The Docker mixin abstracts this logic for you and allows you to specify the Docker commands with the arguments and flags that you want to execute directly in the Porter manifest. The commands currently provided by the Docker mixin are pull, push, run, build, login, and remove. To view all the syntax for the commands, take a look at the [README](https://github.com/deislabs/porter-docker).

Let's go through an example bundle to try out the mixin. First, we will use the Docker mixin to pull and run [docker/whalesay](https://hub.docker.com/r/docker/whalesay/). Then, we will write our own Dockerfile, build it, and push it to Docker Hub.
Let's go through an example bundle to try out the mixin. First, we will use the Docker mixin to pull and run [ghcr.io/getporter/examples/images/whalesay](https://github.com/orgs/getporter/packages/container/package/examples%2Fimages%2Fwhalesay). Then, we will write our own Dockerfile, build it, and push it to Docker Hub.

## Author the bundle
Writing a bundle with the Docker mixin has a few steps:
Expand Down Expand Up @@ -56,19 +56,19 @@ mixins:

### Use Docker CLI

Next, delete the install, upgrade, and uninstall actions. Now, to run docker/whalesay, copy and paste the code below into the porter.yaml to pull the image and then run it with a command to say "Hello World".
Next, delete the install, upgrade, and uninstall actions. Now, to run ghcr.io/getporter/examples/images/whalesay, copy and paste the code below into the porter.yaml to pull the image and then run it with a command to say "Hello World".
```
install:
- docker:
description: "Install Whalesay"
pull:
name: docker/whalesay
name: ghcr.io/getporter/examples/images/whalesay
tag: latest
- docker:
description: "Run Whalesay"
run:
name: dockermixin
image: "docker/whalesay:latest"
image: "ghcr.io/getporter/examples/images/whalesay:latest"
command: cowsay
arguments:
- "Hello World"
Expand Down
12 changes: 6 additions & 6 deletions docs/content/blog/using-docker-in-bundles.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ application, or even more creative tasks that you have already
containerized. Well now you can reuse all that hard work and logic from within
your bundles!

Let's walk through using my favorite container, [docker/whalesay][whalesay], in a bundle.
Let's walk through using my favorite container, [ghcr.io/getporter/examples/images/whalesay][whalesay], in a bundle.

```
_____________________
Expand All @@ -38,7 +38,7 @@ Let's walk through using my favorite container, [docker/whalesay][whalesay], in
\____\______/
```

[whalesay]: https://hub.docker.com/r/docker/whalesay/
[whalesay]: https://github.com/orgs/getporter/packages/container/package/examples%2Fimages%2Fwhalesay

## Author the bundle
Writing a bundle that uses Docker has a few steps:
Expand Down Expand Up @@ -128,7 +128,7 @@ mixins:
install:
- docker:
run:
image: "docker/whalesay:latest"
image: "ghcr.io/getporter/examples/images/whalesay:latest"
rm: true
arguments:
- cowsay
Expand All @@ -137,7 +137,7 @@ install:
upgrade:
- docker:
run:
image: "docker/whalesay:latest"
image: "ghcr.io/getporter/examples/images/whalesay:latest"
rm: true
arguments:
- cowsay
Expand All @@ -146,7 +146,7 @@ upgrade:
say:
- docker:
run:
image: "docker/whalesay:latest"
image: "ghcr.io/getporter/examples/images/whalesay:latest"
rm: true
arguments:
- cowsay
Expand All @@ -155,7 +155,7 @@ say:
uninstall:
- docker:
run:
image: "docker/whalesay:latest"
image: "ghcr.io/getporter/examples/images/whalesay:latest"
rm: true
arguments:
- cowsay
Expand Down
4 changes: 2 additions & 2 deletions docs/content/docs/getting-started/create-bundle.md
Original file line number Diff line number Diff line change
Expand Up @@ -186,13 +186,13 @@ install:
- docker:
description: "Install Whalesay"
pull:
name: docker/whalesay
name: ghcr.io/getporter/examples/images/whalesay
tag: latest
- docker:
description: "Run Whalesay"
run:
name: dockermixin
image: "docker/whalesay:latest"
image: "ghcr.io/getporter/examples/images/whalesay:latest"
command: cowsay
arguments:
- "Hello World"
Expand Down
12 changes: 6 additions & 6 deletions docs/content/docs/references/examples/airgap.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,16 +49,16 @@ images:
whalesayd:
description: "Whalesay as a service"
imageType: "docker"
repository: "carolynvs/whalesayd"
digest: "sha256:8b92b7269f59e3ed824e811a1ff1ee64f0d44c0218efefada57a4bebc2d7ef6f"
repository: "ghcr.io/getporter/examples/images/whalesayd"
digest: "sha256:18c099989986f61c0678b8040cc8d2e80ba20ecd096da51f8da3a31c5d1138b8"
```
The repository field should be the image name, without a tag or digest included, and the digest is the repository digest of the image.
You can get that information by running the following docker command:
```console
$ docker image inspect carolynvs/whalesayd:v0.1.0 --format '{{.RepoDigests}}'
[carolynvs/whalesayd@sha256:8b92b7269f59e3ed824e811a1ff1ee64f0d44c0218efefada57a4bebc2d7ef6f]
$ docker image inspect ghcr.io/getporter/examples/images/whalesayd:v0.1.1 --format '{{.RepoDigests}}'
[ghcr.io/getporter/examples/images/whalesayd@sha256:18c099989986f61c0678b8040cc8d2e80ba20ecd096da51f8da3a31c5d1138b8]
```

### Specify new image location
Expand Down Expand Up @@ -174,12 +174,12 @@ Containers:
Image ID: docker.io/YOURNAME/whalegap@sha256:8b92b7269f59e3ed824e811a1ff1ee64f0d44c0218efefada57a4bebc2d7ef6f
```

From the output of kubectl describe, you can see that the image deployed was not the original image referenced in the bundle, carolynvs/whalesayd, and instead it references a new location _inside_ the relocated bundle repository.
From the output of kubectl describe, you can see that the image deployed was not the original image referenced in the bundle, ghcr.io/getporter/examples/images/whalesayd, and instead it references a new location _inside_ the relocated bundle repository.
All referenced images are published into the same repository as the bundle, and they are only available using their digest, not the original image name.

## Next Steps

* [Understand how Porter publishes archived bundles to a registry](/archive-bundles/)

[ghcr.io/getporter/examples/whalegap]: https://github.com/orgs/getporter/packages/container/package/examples%2Fwhalegap
[whalesay app]: https://github.com/carolynvs/whalesayd
[whalesay app]: https://github.com/orgs/getporter/packages/container/package/examples%2Fimages%2Fwhalesayd
12 changes: 6 additions & 6 deletions docs/content/docs/references/examples/docker.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ application, or even more creative tasks that you have already
containerized. Well now you can reuse all that hard work and logic from within
your bundles!

Let's walk through using my favorite container, [docker/whalesay][whalesay], in a bundle.
Let's walk through using my favorite container, [ghcr.io/getporter/examples/images/whalesay][whalesay], in a bundle.

```
_____________________
Expand All @@ -38,7 +38,7 @@ Let's walk through using my favorite container, [docker/whalesay][whalesay], in
\____\______/
```

[whalesay]: https://hub.docker.com/r/docker/whalesay/
[whalesay]: https://github.com/orgs/getporter/packages/container/package/examples%2Fimages%2Fwhalesay

## Author the bundle
Writing a bundle that uses Docker has a few steps:
Expand Down Expand Up @@ -123,7 +123,7 @@ mixins:
install:
- docker:
run:
image: "docker/whalesay:latest"
image: "ghcr.io/getporter/examples/images/whalesay:latest"
rm: true
arguments:
- cowsay
Expand All @@ -132,7 +132,7 @@ install:
upgrade:
- docker:
run:
image: "docker/whalesay:latest"
image: "ghcr.io/getporter/examples/images/whalesay:latest"
rm: true
arguments:
- cowsay
Expand All @@ -141,7 +141,7 @@ upgrade:
say:
- docker:
run:
image: "docker/whalesay:latest"
image: "ghcr.io/getporter/examples/images/whalesay:latest"
rm: true
arguments:
- cowsay
Expand All @@ -150,7 +150,7 @@ say:
uninstall:
- docker:
run:
image: "docker/whalesay:latest"
image: "ghcr.io/getporter/examples/images/whalesay:latest"
rm: true
arguments:
- cowsay
Expand Down
4 changes: 2 additions & 2 deletions docs/content/mixins/docker.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ You can specify either the tag or the digest.
- docker:
description: "Install Whalesay"
pull:
name: docker/whalesay
name: ghcr.io/getporter/examples/images/whalesay
tag: latest
````

Expand Down Expand Up @@ -183,7 +183,7 @@ You can specify either the tag or the digest.
description: "Run Whalesay"
run:
name: mixinpractice
image: "docker/whalesay:latest"
image: "ghcr.io/getporter/examples/images/whalesay:latest"
detach: true
ports:
- host: 8080
Expand Down

0 comments on commit d6c04b0

Please sign in to comment.