Skip to content

Commit fadeb2b

Browse files
authored
docs: add k8s & aws to offline Dockerfile (#6663)
1 parent 856a802 commit fadeb2b

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

docs/install/offline.md

+10-7
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,9 @@ First, build and push a container image extending our official image with the fo
2727
> Note: Coder includes the latest [supported version](https://github.com/coder/coder/blob/main/provisioner/terraform/install.go#L23-L24) of Terraform in the official Docker images.
2828
> If you need to bundle a different version of terraform, you can do so by customizing the image.
2929
30-
Here's an example:
30+
Here's an example Dockerfile:
3131

3232
```Dockerfile
33-
# Dockerfile
3433
FROM ghcr.io/coder/coder:latest
3534

3635
USER root
@@ -57,21 +56,18 @@ ENV PATH=/opt/terraform:${PATH}
5756

5857
# Additionally, a Terraform mirror needs to be configured
5958
# to download the Terraform providers used in Coder templates.
60-
#
6159
# There are two options:
6260

6361
# Option 1) Use a filesystem mirror. We can seed this at build-time
6462
# or by mounting a volume to /opt/terraform/plugins in the container.
6563
# https://developer.hashicorp.com/terraform/cli/config/config-file#filesystem_mirror
66-
#
6764
# Be sure to add all the providers you use in your templates to /opt/terraform/plugins
6865

6966
RUN mkdir -p /opt/terraform/plugins
7067
ADD filesystem-mirror-example.tfrc /opt/terraform/config.tfrc
7168

7269
# Optionally, we can "seed" the filesystem mirror with common providers.
73-
# Coder and Docker. Comment out lines 40-49 if you plan on only using a
74-
# volume or network mirror:
70+
# Comment out lines 40-49 if you plan on only using a volume or network mirror:
7571
RUN mkdir -p /opt/terraform/plugins/registry.terraform.io
7672
WORKDIR /opt/terraform/plugins/registry.terraform.io
7773
ARG CODER_PROVIDER_VERSION=0.6.10
@@ -82,13 +78,20 @@ ARG DOCKER_PROVIDER_VERSION=3.0.1
8278
RUN echo "Adding kreuzwerker/docker v${DOCKER_PROVIDER_VERSION}" \
8379
&& mkdir -p kreuzwerker/docker && cd kreuzwerker/docker \
8480
&& curl -LOs https://github.com/kreuzwerker/terraform-provider-docker/releases/download/v${DOCKER_PROVIDER_VERSION}/terraform-provider-docker_${DOCKER_PROVIDER_VERSION}_linux_amd64.zip
81+
ARG KUBERNETES_PROVIDER_VERSION=2.18.1
82+
RUN echo "Adding kubernetes/kubernetes v${KUBERNETES_PROVIDER_VERSION}" \
83+
&& mkdir -p kubernetes/kubernetes && cd kubernetes/kubernetes \
84+
&& curl -LOs https://releases.hashicorp.com/terraform-provider-kubernetes/${KUBERNETES_PROVIDER_VERSION}/terraform-provider-kubernetes_${KUBERNETES_PROVIDER_VERSION}_linux_amd64.zip
85+
ARG AWS_PROVIDER_VERSION=4.59.0
86+
RUN echo "Adding aws/aws v${AWS_PROVIDER_VERSION}" \
87+
&& mkdir -p aws/aws && cd aws/aws \
88+
&& curl -LOs https://releases.hashicorp.com/terraform-provider-aws/${AWS_PROVIDER_VERSION}/terraform-provider-aws_${AWS_PROVIDER_VERSION}_linux_amd64.zip
8589

8690
RUN chown -R coder:coder /opt/terraform/plugins
8791
WORKDIR /home/coder
8892

8993
# Option 2) Use a network mirror.
9094
# https://developer.hashicorp.com/terraform/cli/config/config-file#network_mirror
91-
9295
# Be sure uncomment line 60 and edit network-mirror-example.tfrc to
9396
# specify the HTTPS base URL of your mirror.
9497

0 commit comments

Comments
 (0)