diff --git a/website/docs/intro/install/docker-pull.sh b/website/docs/intro/install/docker-pull.sh new file mode 100644 index 0000000000..ef6562e2aa --- /dev/null +++ b/website/docs/intro/install/docker-pull.sh @@ -0,0 +1 @@ +docker pull ghcr.io/opentofu/opentofu:latest diff --git a/website/docs/intro/install/docker-run.sh b/website/docs/intro/install/docker-run.sh new file mode 100644 index 0000000000..60cb527f93 --- /dev/null +++ b/website/docs/intro/install/docker-run.sh @@ -0,0 +1,5 @@ +docker run \ + --workdir=/srv/workspace \ + --mount type=bind,source=.,target=/srv/workspace \ + ghcr.io/opentofu/opentofu:latest \ + init diff --git a/website/docs/intro/install/docker.mdx b/website/docs/intro/install/docker.mdx new file mode 100644 index 0000000000..d3c2ce42ac --- /dev/null +++ b/website/docs/intro/install/docker.mdx @@ -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: + +- ``-``: a platform specific version of OpenTofu. + +## Usage + +To pull the image from GitHub Packages registry: + +{DockerPullScript} + +To run OpenTofu as a Docker container: + +{DockerRunScript} + +:::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. + +::: diff --git a/website/docs/intro/install/index.mdx b/website/docs/intro/install/index.mdx index 4c30f8b4f4..7fe0d735f2 100644 --- a/website/docs/intro/install/index.mdx +++ b/website/docs/intro/install/index.mdx @@ -59,5 +59,12 @@ You can install OpenTofu via a wide range of methods. Please select your operati description: "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.", + }, ]} />