-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Docker - TF is already initialized, but it trying to download modules #19
Comments
That's strange, I tested it on my Windows computer using PowerShell and didn't encounter any error.... Have you tried building the Docker image yourself? If the error still exists then maybe we need to update some things in the Dockerfile (such as installing Git in the container) |
@lkurzyniec Also if you managed to get it work, could you please let me know how? Thanks |
My log is reduced, but all entries says that terraform is trying to download modules from external sources ( |
I see. This is actually how it was meant to be be done I guess, because the Docker image that I created (which was built essentially in the same way that the original one was built in) doesn't copy over the .terraform folders, only the .tf and .tfvars files. This is so that people can run the visualization in a non-Terraform init directory but still expect the same results. Do you think it would be good to copy the .terraform folder directly? |
The design is correct - it should work the same for init and non-init environments. But in my case, where I'm using modules from a private repository, the only way to solve the issue would be to provide git creds (login/password or token) that terraform would be allowed to download modules from the private repo. That's a security risk. Maybe the option here would be a flag/parameter to copy also |
Hi, I think that idea is great! I've seen other forks before specify Git as something to download in the Dockerfile.. but wasn't sure why... now I know. I'll try to work on adding a flag, but could you please explain more about what you mean when you say "Linux version (Linux providers downloaded)"? |
Sorry @lkurzyniec I just wanted to confirm this is what you're talking about.... ? |
@Ianyliu no worries about delays. everyone has its own duties ;) by 'Linux version (Linux providers downloaded)' I mean that - terraform is multiplatform, but you are running blast on alpine, which is linux based, so terraform have to be initialized with linux providers (instead of windows for example). |
when we are invoking this command |
Hi @lkurzyniec You can install via: If you need me to create a Docker dev branch, please let me know and I will do that |
@Ianyliu please create a Docker image for me. I can work only with docker. |
The newest image gives me an error:
|
I have created a repo to test your work. The results of |
Okay, I'll have a look later. |
Hi @lkurzyniec , I haven't looked at your repo yet, but I rebuilt an image. Could you please test it out and see if it works? |
@Ianyliu the same error - I added you to my repository as a collaborator. Feel free to run the pipeline (https://github.com/lkurzyniec/azure-regions-public/actions/workflows/docker.yml) to see the results. |
Sorry @lkurzyniec I wasn't sure why you shared it with me or how to use GitHub workflows, but now it seems like I have it figured out. Also I just realized why things weren't working.... it's because I switched from Mac to Windows and the filepath is different on Windows (\ is file separator)...... I can't believe it took me so long to figure out something so simple 😅 Not sure if I need to switch machines though... |
@lkurzyniec Can you help me configure a GitHub workflow so that a Docker image is pushed to Docker Hub every time there's a pull request or push to the main branch? |
@Ianyliu To achieve that, simply use the instructions from the action repo: https://github.com/docker/build-push-action/tree/v3 (copy&paste, then adjust). |
@Ianyliu finally managed to visualize my terraform. I used different tool. here you can find my current solution: im2nguyen/rover#115 (comment) |
@lkurzyniec Sorry for the wait, I was busy with school. I indeed have used the tool you mentioned, and I also recommend Pluralith. I do have to admit that they might be better tools than Blast Radius. The only major difference of Blast Radius is the way it visualizes the infrastructure. I did spend time looking at the workflow, but I was quite confused and later chose to stop working on this project as a whole due to schoolwork. If you do have time someday to spare, please let me know if my latest image works for you. (I checked the workflow and the app ran successfully but timed out) Regardless of everything, I hope it went well for you in the end. |
@Ianyliu I notice that you are able to run workflow on your side. that's good. it looks better. I see that blastradius runs in a container ( |
I have initialized root module. Running with docker I'm getting
I'm using PowerShell and running docker on Windows.
The text was updated successfully, but these errors were encountered: