generated from crossplane-contrib/provider-jet-template
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update the Dockerfile to fit terrajet controller template format
Signed-off-by: Marques Johansson <mjohansson@equinix.com>
- Loading branch information
Showing
3 changed files
with
80 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,52 @@ | ||
FROM gcr.io/distroless/static@sha256:1f580b0a1922c3e54ae15b0758b5747b260bd99d39d40c2edb3e7f6e2452298b | ||
FROM BASEIMAGE | ||
RUN apk --no-cache add ca-certificates bash | ||
|
||
ARG TARGETOS | ||
ARG TARGETARCH | ||
ARG TINI_VERSION | ||
ENV USER_ID=1001 | ||
|
||
# Setup Terraform environment | ||
|
||
## Provider-dependent configuration | ||
ARG TERRAFORM_VERSION | ||
ARG TERRAFORM_PROVIDER_SOURCE | ||
ARG TERRAFORM_PROVIDER_VERSION | ||
ARG TERRAFORM_PROVIDER_DOWNLOAD_NAME | ||
ARG TERRAFORM_PROVIDER_DOWNLOAD_URL_PREFIX | ||
ARG TERRAFORM_NATIVE_PROVIDER_BINARY | ||
## End of - Provider-dependent configuration | ||
|
||
ENV PLUGIN_DIR /terraform/provider-mirror/registry.terraform.io/${TERRAFORM_PROVIDER_SOURCE}/${TERRAFORM_PROVIDER_VERSION}/${TARGETOS}_${TARGETARCH} | ||
ENV TF_CLI_CONFIG_FILE /terraform/.terraformrc | ||
ENV TF_FORK 0 | ||
|
||
RUN mkdir -p ${PLUGIN_DIR} | ||
|
||
ADD https://releases.hashicorp.com/terraform/${TERRAFORM_VERSION}/terraform_${TERRAFORM_VERSION}_${TARGETOS}_${TARGETARCH}.zip /tmp | ||
ADD ${TERRAFORM_PROVIDER_DOWNLOAD_URL_PREFIX}/${TERRAFORM_PROVIDER_DOWNLOAD_NAME}_${TERRAFORM_PROVIDER_VERSION}_${TARGETOS}_${TARGETARCH}.zip /tmp | ||
|
||
ADD terraformrc.hcl ${TF_CLI_CONFIG_FILE} | ||
|
||
RUN unzip /tmp/terraform_${TERRAFORM_VERSION}_${TARGETOS}_${TARGETARCH}.zip -d /usr/local/bin \ | ||
&& chmod +x /usr/local/bin/terraform \ | ||
&& rm -f /tmp/terraform_${TERRAFORM_VERSION}_${TARGETOS}_${TARGETARCH}.zip \ | ||
&& unzip /tmp/${TERRAFORM_PROVIDER_DOWNLOAD_NAME}_${TERRAFORM_PROVIDER_VERSION}_${TARGETOS}_${TARGETARCH}.zip -d /tmp/ \ | ||
&& mv /tmp/${TERRAFORM_NATIVE_PROVIDER_BINARY} ${PLUGIN_DIR} \ | ||
&& chmod +x ${PLUGIN_DIR}/${TERRAFORM_NATIVE_PROVIDER_BINARY} \ | ||
&& rm -f /tmp/${TERRAFORM_PROVIDER_DOWNLOAD_NAME}_${TERRAFORM_PROVIDER_VERSION}_${TARGETOS}_${TARGETARCH}.zip \ | ||
&& chown -R ${USER_ID}:${USER_ID} /terraform | ||
# End of - Setup Terraform environment | ||
|
||
ADD bin/$TARGETOS\_$TARGETARCH/provider /usr/local/bin/crossplane-equinix-provider | ||
|
||
USER 65532 | ||
# Provider controller needs these environment variable at runtime | ||
ENV TERRAFORM_VERSION ${TERRAFORM_VERSION} | ||
ENV TERRAFORM_PROVIDER_SOURCE ${TERRAFORM_PROVIDER_SOURCE} | ||
ENV TERRAFORM_PROVIDER_VERSION ${TERRAFORM_PROVIDER_VERSION} | ||
ENV TERRAFORM_NATIVE_PROVIDER_PATH ${PLUGIN_DIR}/${TERRAFORM_NATIVE_PROVIDER_BINARY} | ||
|
||
USER ${USER_ID} | ||
EXPOSE 8080 | ||
|
||
ENTRYPOINT ["crossplane-equinix-provider"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
provider_installation { | ||
filesystem_mirror { | ||
path = "/terraform/provider-mirror" | ||
include = ["*/*"] | ||
} | ||
direct { | ||
exclude = ["*/*"] | ||
} | ||
} |