Add page about official OpenTofu Docker image (#1271)

Signed-off-by: Nikita Barskov <nbarskov@gmail.com>
Signed-off-by: Janos <86970079+janosdebugs@users.noreply.github.com>
Co-authored-by: Janos <86970079+janosdebugs@users.noreply.github.com>
This commit is contained in:
Nikita Barskov 2024-02-19 20:09:46 +01:00 committed by GitHub
parent ee72400176
commit 851391f2e6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 63 additions and 0 deletions

View File

@ -0,0 +1 @@
docker pull ghcr.io/opentofu/opentofu:latest

View File

@ -0,0 +1,5 @@
docker run \
--workdir=/srv/workspace \
--mount type=bind,source=.,target=/srv/workspace \
ghcr.io/opentofu/opentofu:latest \
init

View File

@ -0,0 +1,50 @@
---
sidebar_position: 99
sidebar_label: OCI container image
description: |-
Use official OCI container image available on GitHub Container Registry.
---
import CodeBlock from '@theme/CodeBlock';
import DockerPullScript from '!!raw-loader!./docker-pull.sh'
import DockerRunScript from '!!raw-loader!./docker-run.sh'
# Use OpenTofu as Docker Image
OpenTofu is available as [OCI container images](https://github.com/opentofu/opentofu/pkgs/container/opentofu),
and distributed via public GitHub Packages registry.
## Versions
Images are hosted as packages in opentofy GitHub organization. See the list
of available versions [here](https://github.com/opentofu/opentofu/pkgs/container/opentofu/versions?filters%5Bversion_type%5D=tagged).
The multi platform images are available using the following tags:
- `latest`: latest overall version of OpenTofu,
- `Major`: a specific major version of OpenTofu,
- `Major`.`Minor`: a specific minor version of OpenTofu,
- `Major`.`Minor`.`Patch`: a specific patch version of OpenTofu.
To pull platform-specific images (`amd64`, `arm`, `arm64`, `386`) use:
- `<Version>`-`<Platform>`: a platform specific version of OpenTofu.
## Usage
To pull the image from GitHub Packages registry:
<CodeBlock language="bash">{DockerPullScript}</CodeBlock>
To run OpenTofu as a Docker container:
<CodeBlock language="bash">{DockerRunScript}</CodeBlock>
:::tip
If you run into rate limiting issues with GitHub, create a
[Personal Access Token](https://github.com/settings/tokens) and
[log in](https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-container-registry#authenticating-to-the-container-registry)
to the registry.
:::

View File

@ -59,5 +59,12 @@ You can install OpenTofu via a wide range of methods. Please select your operati
description: description:
"Use OpenTofu without installation on Linux, MacOS, Windows or FreeBSD.", "Use OpenTofu without installation on Linux, MacOS, Windows or FreeBSD.",
}, },
{
type: "link",
href: "/docs/intro/install/docker",
label: "OCI container image",
description:
"Use official OCI container image available on GitHub Container Registry.",
},
]} ]}
/> />