Open dprosper opened 5 years ago
even after making these changes in my local Dockerfile and creating a new image, I was still getting the error of not finding the ibm provider. I ended up placing the provider inside the /root/.terraform.d/plugins
folder and it finally worked.
Hi The binary is available as part of /go/bin/ directory.
$ docker pull ibmterraform/terraform-provider-ibm-docker $ docker run -it ibmterraform/terraform-provider-ibm-docker:latest
I performed this steps and logged into container. I'm able to successfully run terraform commands
I don't understand why my experience would be any different since I am pulling the same image with the same commands.
What about this file, are the result for a cat command what you expect and want?
bash-4.4# cat /root/.terraformrc
providers {
ibm = "/go/bin/terraform-provider-ibm_v${TERRAFORM_IBMCLOUD_VERSION}"
}
bash-4.4#
I have narrowed down the issue. It seems to happen in templates that have the provider section, like in this example:
provider "ibm" {
version = "0.17.6"
ibmcloud_api_key = "${var.ibm_bmx_api_key}"
iaas_classic_username = "${var.ibm_sl_username}"
iaas_classic_api_key = "${var.ibm_sl_api_key}"
}
Once you add this version restriction it fails.
While running trying to use the docker image available from DockerHub I received the following error message:
Reviewing the docker file it looks like the command that generates the terraformrc is not working as expected, if you look at the inside of the docker image as pulled from DockerHub you find that the terraformrc looks like this:
That is because the single ' used to generate the file don't result in the environment variable to be properly evaluated. Instead you need to modify the RUN command to do the following: