-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from turkenf/prep-no-fork
Switch no-fork architecture
- Loading branch information
Showing
14 changed files
with
289 additions
and
154 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,51 +1,11 @@ | ||
FROM alpine:3.20.3 | ||
RUN apk --no-cache add ca-certificates bash | ||
|
||
ARG TARGETOS | ||
ARG TARGETARCH | ||
|
||
ADD "bin/${TARGETOS}_${TARGETARCH}/provider" /usr/local/bin/provider | ||
|
||
ENV USER_ID=65532 | ||
|
||
# Setup Terraform environment | ||
|
||
## Provider-dependent configuration | ||
ARG TERRAFORM_VERSION | ||
ARG TERRAFORM_PROVIDER_SOURCE | ||
ARG TERRAFORM_PROVIDER_VERSION | ||
ARG TERRAFORM_PROVIDER_DOWNLOAD_NAME | ||
ARG TERRAFORM_NATIVE_PROVIDER_BINARY | ||
ARG TERRAFORM_PROVIDER_DOWNLOAD_URL_PREFIX | ||
|
||
## 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}_v${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 /tmp/terraform_${TERRAFORM_VERSION}_${TARGETOS}_${TARGETARCH}.zip \ | ||
&& unzip /tmp/${TERRAFORM_PROVIDER_DOWNLOAD_NAME}_v${TERRAFORM_PROVIDER_VERSION}_${TARGETOS}_${TARGETARCH}.zip -d ${PLUGIN_DIR} \ | ||
&& chmod +x ${PLUGIN_DIR}/* \ | ||
&& rm /tmp/${TERRAFORM_PROVIDER_DOWNLOAD_NAME}_v${TERRAFORM_PROVIDER_VERSION}_${TARGETOS}_${TARGETARCH}.zip \ | ||
&& chown -R ${USER_ID}:${USER_ID} /terraform | ||
# End of - Setup Terraform environment | ||
|
||
# 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 | ||
|
||
ADD "bin/${TARGETOS}_${TARGETARCH}/provider" /usr/local/bin/provider | ||
|
||
ENTRYPOINT ["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
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
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
Oops, something went wrong.