Docker templates not working whenever a subfolder is used
If the docker images are in a subfolder, the workspace will straight up fail to create.
here are the logs :
Initializing the backend...
Initializing provider plugins...
- Finding kreuzwerker/docker versions matching "2.22.0"...
- Finding coder/coder versions matching "0.5.0-pre"...
- Using kreuzwerker/docker v2.22.0 from the shared cache directory
- Using coder/coder v0.5.0-pre from the shared cache directory
Terraform has created a lock file .terraform.lock.hcl to record the provider
selections it made above. Include this file in your version control repository
so that Terraform can guarantee to make the same selections by default when
you run "terraform init" in the future.
Warning: Incomplete lock file information for providers
Due to your customized provider installation methods, Terraform was forced to
calculate lock file checksums locally for the following providers:
- coder/coder
- kreuzwerker/docker
The current .terraform.lock.hcl file only includes checksums for linux_amd64,
so Terraform running on another platform will fail to install these
providers.
To calculate additional checksums for another platform, run:
terraform providers lock -platform=linux_amd64
(where linux_amd64 is the platform to generate)
Terraform has been successfully initialized!
You may now begin working with Terraform. Try running "terraform plan" to see
any changes that are required for your infrastructure. All Terraform commands
should now work.
If you ever set or change modules or backend configuration for Terraform,
rerun this command to reinitialize your working directory. If you forget, other
commands will detect it and remind you to do so if necessary.
Terraform 1.3.0
data.coder_workspace.me: Refreshing...
data.coder_workspace.me: Refresh complete after 0s [id=03c744e4-e924-4214-b422-06cd7556814c]
coder_agent.dev: Plan to create
coder_app.novnc[0]: Plan to create
coder_app.code-server: Plan to create
docker_volume.home_volume: Plan to create
docker_image.workspace_image: Plan to create
docker_container.workspace[0]: Plan to create
Plan: 6 to add, 0 to change, 0 to destroy.
docker_volume.home_volume: Creating...
coder_agent.dev: Creating...
docker_image.workspace_image: Creating...
coder_agent.dev: Creation complete after 0s [id=978ef762-a4ed-4349-8449-de7139524e92]
coder_app.novnc[0]: Creating...
coder_app.code-server: Creating...
coder_app.novnc[0]: Creation complete after 0s [id=7677e148-29f1-40a2-8cdb-b43a9ea07c03]
coder_app.code-server: Creation complete after 0s [id=8d2e3337-6606-473f-9e9a-1da771f61220]
docker_volume.home_volume: Creation complete after 1s [id=coder-phorcys-testworkspace-root]
docker_image.workspace_image: Creation errored after 2s
Initializing the backend...
Initializing provider plugins...
- Finding kreuzwerker/docker versions matching "2.22.0"...
- Finding coder/coder versions matching "0.5.0-pre"...
- Using kreuzwerker/docker v2.22.0 from the shared cache directory
- Using coder/coder v0.5.0-pre from the shared cache directory
Terraform has created a lock file .terraform.lock.hcl to record the provider
selections it made above. Include this file in your version control repository
so that Terraform can guarantee to make the same selections by default when
you run "terraform init" in the future.
Warning: Incomplete lock file information for providers
Due to your customized provider installation methods, Terraform was forced to
calculate lock file checksums locally for the following providers:
- coder/coder
- kreuzwerker/docker
The current .terraform.lock.hcl file only includes checksums for linux_amd64,
so Terraform running on another platform will fail to install these
providers.
To calculate additional checksums for another platform, run:
terraform providers lock -platform=linux_amd64
(where linux_amd64 is the platform to generate)
Terraform has been successfully initialized!
You may now begin working with Terraform. Try running "terraform plan" to see
any changes that are required for your infrastructure. All Terraform commands
should now work.
If you ever set or change modules or backend configuration for Terraform,
rerun this command to reinitialize your working directory. If you forget, other
commands will detect it and remind you to do so if necessary.
Terraform 1.3.0
data.coder_workspace.me: Refreshing...
data.coder_workspace.me: Refresh complete after 0s [id=03c744e4-e924-4214-b422-06cd7556814c]
coder_agent.dev: Plan to create
coder_app.novnc[0]: Plan to create
coder_app.code-server: Plan to create
docker_volume.home_volume: Plan to create
docker_image.workspace_image: Plan to create
docker_container.workspace[0]: Plan to create
Plan: 6 to add, 0 to change, 0 to destroy.
docker_volume.home_volume: Creating...
coder_agent.dev: Creating...
docker_image.workspace_image: Creating...
coder_agent.dev: Creation complete after 0s [id=978ef762-a4ed-4349-8449-de7139524e92]
coder_app.novnc[0]: Creating...
coder_app.code-server: Creating...
coder_app.novnc[0]: Creation complete after 0s [id=7677e148-29f1-40a2-8cdb-b43a9ea07c03]
coder_app.code-server: Creation complete after 0s [id=8d2e3337-6606-473f-9e9a-1da771f61220]
docker_volume.home_volume: Creation complete after 1s [id=coder-phorcys-testworkspace-root]
docker_image.workspace_image: Creation errored after 2s
13 Replies
on the other hand, if I move the docker image to the root of the folder, it will not fail
in my case it will fail because I am using
ADD
on a file that is in a subfolder
here are the logs :
Initializing the backend...
Initializing provider plugins...
- Finding kreuzwerker/docker versions matching "2.22.0"...
- Finding coder/coder versions matching "0.5.0-pre"...
- Using coder/coder v0.5.0-pre from the shared cache directory
- Using kreuzwerker/docker v2.22.0 from the shared cache directory
Terraform has created a lock file .terraform.lock.hcl to record the provider
selections it made above. Include this file in your version control repository
so that Terraform can guarantee to make the same selections by default when
you run "terraform init" in the future.
Warning: Incomplete lock file information for providers
Due to your customized provider installation methods, Terraform was forced to
calculate lock file checksums locally for the following providers:
- coder/coder
- kreuzwerker/docker
The current .terraform.lock.hcl file only includes checksums for linux_amd64,
so Terraform running on another platform will fail to install these
providers.
To calculate additional checksums for another platform, run:
terraform providers lock -platform=linux_amd64
(where linux_amd64 is the platform to generate)
Terraform has been successfully initialized!
You may now begin working with Terraform. Try running "terraform plan" to see
any changes that are required for your infrastructure. All Terraform commands
should now work.
If you ever set or change modules or backend configuration for Terraform,
rerun this command to reinitialize your working directory. If you forget, other
commands will detect it and remind you to do so if necessary.
Terraform 1.3.0
data.coder_workspace.me: Refreshing...
data.coder_workspace.me: Refresh complete after 0s [id=16d848b7-9f31-47f2-b8bc-95686e9cdbe7]
coder_agent.dev: Plan to create
docker_volume.home_volume: Plan to create
coder_app.code-server: Plan to create
coder_app.novnc[0]: Plan to create
docker_image.workspace_image: Plan to create
docker_container.workspace[0]: Plan to create
Plan: 6 to add, 0 to change, 0 to destroy.
docker_volume.home_volume: Creating...
coder_agent.dev: Creating...
coder_agent.dev: Creation complete after 0s [id=ca6f8d14-37cf-4b1a-b376-40ff6a96c2df]
docker_image.workspace_image: Creating...
coder_app.code-server: Creating...
coder_app.novnc[0]: Creating...
coder_app.code-server: Creation complete after 0s [id=c9631ceb-9135-496a-ae3e-bf7bab94e250]
coder_app.novnc[0]: Creation complete after 0s [id=65deecfc-39b2-4703-8b51-a655375d76bd]
docker_volume.home_volume: Creation complete after 0s [id=coder-phorcys-testworkspace-root]
docker_image.workspace_image: Creation errored after 1s
Error: failed to compute cache key: "/novnc/webutil.js" not found: not found
Initializing the backend...
Initializing provider plugins...
- Finding kreuzwerker/docker versions matching "2.22.0"...
- Finding coder/coder versions matching "0.5.0-pre"...
- Using coder/coder v0.5.0-pre from the shared cache directory
- Using kreuzwerker/docker v2.22.0 from the shared cache directory
Terraform has created a lock file .terraform.lock.hcl to record the provider
selections it made above. Include this file in your version control repository
so that Terraform can guarantee to make the same selections by default when
you run "terraform init" in the future.
Warning: Incomplete lock file information for providers
Due to your customized provider installation methods, Terraform was forced to
calculate lock file checksums locally for the following providers:
- coder/coder
- kreuzwerker/docker
The current .terraform.lock.hcl file only includes checksums for linux_amd64,
so Terraform running on another platform will fail to install these
providers.
To calculate additional checksums for another platform, run:
terraform providers lock -platform=linux_amd64
(where linux_amd64 is the platform to generate)
Terraform has been successfully initialized!
You may now begin working with Terraform. Try running "terraform plan" to see
any changes that are required for your infrastructure. All Terraform commands
should now work.
If you ever set or change modules or backend configuration for Terraform,
rerun this command to reinitialize your working directory. If you forget, other
commands will detect it and remind you to do so if necessary.
Terraform 1.3.0
data.coder_workspace.me: Refreshing...
data.coder_workspace.me: Refresh complete after 0s [id=16d848b7-9f31-47f2-b8bc-95686e9cdbe7]
coder_agent.dev: Plan to create
docker_volume.home_volume: Plan to create
coder_app.code-server: Plan to create
coder_app.novnc[0]: Plan to create
docker_image.workspace_image: Plan to create
docker_container.workspace[0]: Plan to create
Plan: 6 to add, 0 to change, 0 to destroy.
docker_volume.home_volume: Creating...
coder_agent.dev: Creating...
coder_agent.dev: Creation complete after 0s [id=ca6f8d14-37cf-4b1a-b376-40ff6a96c2df]
docker_image.workspace_image: Creating...
coder_app.code-server: Creating...
coder_app.novnc[0]: Creating...
coder_app.code-server: Creation complete after 0s [id=c9631ceb-9135-496a-ae3e-bf7bab94e250]
coder_app.novnc[0]: Creation complete after 0s [id=65deecfc-39b2-4703-8b51-a655375d76bd]
docker_volume.home_volume: Creation complete after 0s [id=coder-phorcys-testworkspace-root]
docker_image.workspace_image: Creation errored after 1s
Error: failed to compute cache key: "/novnc/webutil.js" not found: not found
actually, if I use the
ADD
directive on any file, it failshere it actually builds if I remove all the
ADD
directiveswell, tries to build, since it's trying to chmod a file that doesn't exist
also I realised that this is the structure of the tar file when doing
coder pull
, could it be related ?actually, those are already things I outlined in https://github.com/coder/coder/issues/2815, but i'm trying to revive this via the discord
@kyle got any time to look at this ?
I faced the same issue while using
ADD
in one of templates. this is a context issue. I think terraform
is not able to get the full context.
Also, I ended up removing the ADD
and writing everything in the Dockerfile
.I can't do that though
the file is very big
I can build the image independently for now but it's kind of annoying because it stops the "all-in-one update" spirit that I'm used to with coder
i feel you
would be nice if there was some news on this.. @Ben could you take a look at this ?
Thanks for the bump! No news yet but we'll prioritize this since it's a pretty big deal for Windows users
fixed long time ago btw