-
Notifications
You must be signed in to change notification settings - Fork 739
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
Dockerize wrangler #1316
Comments
Hi @mrpatrick! Thanks for submitting a feature request + suggested PR :). Before we consider adding a new feature to Wrangler, we need to think about how it fits into the Wrangler user experience. A couple of questions with respect to your feature:
Again, thanks for reaching out to us, and we're looking forward to hear more of your rationale for this feature. |
Hi @gabbifish - thanks for considering. See inline below
Doesn't rely on npm/node (or knowledge on using node/npm), os libraries, software updates, etc. You just need docker - that's it. This makes "installing" easy (i.e. I can use this program even though I don't have node/npm on my laptop). It always makes updates easier and doesn't rely on 3rd party libraries / software other than docker (i.e. no conflicts / issues with updates). it's fully self contained. Docker is well established platform and most CLI's and services have an official docker version. This would help wrangler become more widely accepted and provide greater availability / visibility.
Suggested workflow is documented here: cloudflare/wrangler-legacy#338 This is of course how I'm using it and others may have better suggestions / improvements to this.
I would suggest providing both methods (as keeping with docker best practices and standards). If you take a look at my PR, it's just adding 2 files: Dockerfile, .dockerignore to the repo. That allows other to build the image as they see fit as well as provide an docker image via docker registry like I'm currently doing via our company repo: https://hub.docker.com/r/avatarnewyork/wrangler
I would suggest having an official wrangler docker repo (or maybe under cloudflare's docker repo)? Of course it's not required but would give it more visibility to the community and make it easier to find / use. In regards to image builds/maint, I would suggest integrating the build within your existing CI workflow (or, if that is too much of a pain, a less ideal option would be to kick off an automated build on the docker registry. This of course, wouldn't allow you to run any tests though, which could be done as part of your CI process). If you prefer NOT to host your own binary / image, you could just provide the dockerfile to allow others to build, but won't have the same impact. |
Hi @mrpatrick! Thanks so much for being patient! The maintainer team has discussed maintaining a dockerized solution. It is definitely on our roadmap for the future--I'd be keen to experiment with GitHub actions to see how we could accomplish automated publishing in as clean a fashion as possible. Do you mind if we keep your PR on ice for now as we think about how to possibly integrate this with new infrastructure like GitHub actions and how this fits into our milestone planning? In the meantime, you're also welcome to share your dockerized implementation around with other Wrangler users! |
Hi @gabbifish - glad it's on the roadmap and all sounds good. Thanks! Pat |
I agree wholeheartedly with putting wrangler into docker, because not just npm but also rustup could be configured so that the user doesn't have to install the lot on the local machine. However, I don't think the preview command would work from inside the docker container. So may I suggest using the normal wrangler install, and it asking if the user wants to user docker or install rust and/or npm modules locally (if docker is detected)? Then, the wrapper command can call build inside the docker container but call preview from outside the container. |
It would be really good to have it dockerized. I would like to automate the deployment of my workers using Bitbucket Pipelines and having it dockerized would help to just use it in a I'm looking forward to an official image. |
Gitlab also uses docker images for its ci - using Wrangler would be much easier with a docker image that could just be pulled from Docker Hub. |
This would be really, really useful. I was loving the experience until I tried getting wrangler to work on Circle CI and then ran into a brick wall. The only way you can do a global install in a circle CI docker image is by using sudo, which doesn't install wrangler properly. If anyone other than cloudflare built wrangler, I would have dropped it already, but I'm really keen to use this so I'm building a custom docker image for use in circle CI. An official wrangler image with node would have made all of this a non issue |
What's the state of this issue? This would be great to insert the publish step on a pipeline. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
I still think that this ticket is very important! |
Leaving my support for this, I would love to have an official wrangler docker image available. I'd really like to use this for a gitlab runner. |
Or if the cloudflare team is not willing to provide support to this, at least inform that there is a community-project providing a docker image (https://github.com/avatarnewyork/wrangler) |
In the meantime: for those who want to deploy with Github Actions, there is |
I'm a little surprised not to find official support for a Docker image. https://hub.docker.com/r/avatarnewyork/wrangler sounds like it will suffice, but can understand why an official image might not currently exist, if I'm honest. |
Adding another user case with my upvote. If producing a pull-able image hinders delivery, just n officially sanctioned Dockerfile in the repo would do, since anyone will be able to @gabbifish (or anyone else at Cloudflare): Do you have any news about progress/roadmap on this? |
🙏 this would be really helpful for CI. especially as images like |
Adding another use case with my upvote. |
I agree that an official image would be amazing. I'm using Wrangler with Bitbucket Pipelines and I had to use the official Node image and run the following: script:
- npm -g config set user root
- npm install -g @cloudflare/wrangler
- wrangler publish I know that installing the library in every deployment could be a problem, but it is taking 4s to do it, so not a big problem. |
Created a Docker example for Windows using Nano Server. |
Transferred from Wrangler 1 repo. I think there appears to still be interest in having a Docker image, even for Wrangler 2. |
Yeah, I still want this, having been following this issue for years. As you said, it should be relatively easy to create a FROM node
RUN npm install -g wrangler
ENTRYPOINT ["wrangler"] Nothing remarkable, really. The sole reason why I want this is not due to the difficulty, but I want some authoritative sources of the Docker images I use daily. |
We don't currently have plans to create an official Docker image for wrangler. @barosl's suggestion above seems to cover the bases. Closing for now. |
Suggestion
build
The text was updated successfully, but these errors were encountered: