How to use coder_parameter to force_rebuild docker images?
Hi there,
I saw this in the docs:
(source: https://coder.com/docs/@v2.19.0/admin/templates/extending-templates/parameters#ephemeral-parameters)
How I want to add this feature to my current template.
I guess I need to use the
force_rebuild
somewhere in order to really force the rebuild of the image, right?
Probably in the triggers here:
Would this work? Thanks!20 Replies
<#1336684655717650493>
Category
Help needed
Product
Coder (v2)
Platform
Linux
Logs
Please post any relevant logs/error messages.
It should work as per the provider docs.
Any chnage in
triggers
should trigger an image build.Thanks @Atif!
So this should work?
Yes it shoudl work even without sha1
hey @Zoker, did you get it to work?
Hi @Phorcys, no I don't think so.
I added it to my terraform file. Then I updated my coder workspace. During the initializsation of this, I got this promt here (apt update && apt upgrade are run on every workspace start):

In my Dockerfile I have this part:

For me that means, that even after I selected this option here, the docker image was not rebuild:

Otherwhise there would not have been any apt packages to update
did you do it with or without sha1?
this message, sorry
Without the sha1.
Here is the full tf file:
https://gist.zkr.dev/FlorianGareis/8170896d2bd14fefb2af886e433f5364#file-base-tf-154
@Phorcys Do you have any idea, why it's not working?
I can't find anything on the matter, you could try downgrading the provider to v2.5.0 to see if it works
https://github.com/kreuzwerker/terraform-provider-docker/issues/571
GitHub
docker_image build image even if file context and dockerfile doesn'...
Community Note Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request Please do not leave "+1" or "me to...
But the code should work like it is currently, right?
sorry for the delay, yes it should, I think there's a bug in the provider
Should I open a GitHub issue or something for it?
you can but the provider's repo is pretty dead sadly, I would recommend trying to find a workaround instead
I'll try to have a stab at it next week
hey @Zoker, sorry, haven't got the time to try yet, have you figured it out?
After a lot more debugging I think the issue is, that I did not enable the
no_cache
option for the docker build.
So the flag did trigger a rebuild, but since the dockerfile itself did not change, the cache would kick in and the same image would be used again 😅oh okay
that is a bit annoying though but i'm not sure there's much you can do
But as long as it works I'm happy 😄
Thanks for the support!
@Phorcys closed the thread.