Skip to content
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

Closed
mrpatrick opened this issue Jul 22, 2019 · 23 comments
Closed

Dockerize wrangler #1316

mrpatrick opened this issue Jul 22, 2019 · 23 comments
Labels
enhancement New feature or request quick win Potentially easy/straightforward issue to tackle

Comments

@mrpatrick
Copy link

Suggestion

  • It would be great to have a dockerized version of this program that is self-contained
  • include an option to for build-required files (i.e. cache the template requirements in the image so they don't have to be downloaded everytime you call build
  • include node version option
@gabbifish
Copy link
Contributor

gabbifish commented Jul 22, 2019

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:

  1. How does this dockerized version of Wrangler improve Wrangler setup and usage? What pain points does it address?
  2. What is the intended workflow for using this dockerized Wrangler binary?
  3. How would this dockerized distribution of wrangler be distributed? Would folks need to always build the container themself? Would this be an image folks would use from the docker registry? How will the dockerized wrangler binary be maintained and updated with new point releases? (Maintaining a docker registry binary would be an additional burden on the Wrangler maintainers if there's not a huge benefit to using wrangler via docker anyways).

Again, thanks for reaching out to us, and we're looking forward to hear more of your rationale for this feature.

@mrpatrick
Copy link
Author

Hi @gabbifish - thanks for considering. See inline below

  1. How does this dockerized version of Wrangler improve Wrangler setup and usage? What pain points does it address?

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.

  1. What is the intended workflow for using this dockerized Wrangler binary?

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.

How would this dockerized distribution of wrangler be distributed? Would folks need to always build the container themself? Would this be an image folks would use from the docker registry?

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

How will the dockerized wrangler binary be maintained and updated with new point releases? (Maintaining a docker registry binary would be an additional burden on the Wrangler maintainers if there's not a huge benefit to using wrangler via docker anyways).

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.

@gabbifish
Copy link
Contributor

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!

@mrpatrick
Copy link
Author

Hi @gabbifish - glad it's on the roadmap and all sounds good. Thanks!

Pat

@aqueenan
Copy link

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.

@lisotton
Copy link

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 bitbucket-pipelines.yml instead of maintain my own container, rely on third-party containers or install NPM package for every deployment.

I'm looking forward to an official image.

@Albitos
Copy link

Albitos commented Mar 26, 2020

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.

@abury
Copy link
Contributor

abury commented Apr 1, 2020

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

@Serrvosky
Copy link

What's the state of this issue? This would be great to insert the publish step on a pipeline.

@stale
Copy link

stale bot commented Sep 5, 2020

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.

@lisotton
Copy link

lisotton commented Sep 6, 2020

I still think that this ticket is very important!

@Disgruntled
Copy link

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.

@oliverpool
Copy link
Contributor

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)

@Electroid
Copy link
Contributor

In the meantime: for those who want to deploy with Github Actions, there is cloudflare/wrangler-action.

@dynamite-ready
Copy link

dynamite-ready commented Dec 12, 2020

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.

@pataquets
Copy link

Adding another user case with my upvote.
I want to follow the Cloudflare workers Rust tutorials, and having to install all the node, npm, etc. especially not being a JavaScript expert looks daunting to me and raises the concern of breaking my local, since I'm not on a recent distro and adding third party repos can be risky.

If producing a pull-able image hinders delivery, just n officially sanctioned Dockerfile in the repo would do, since anyone will be able to docker build -t wrangler github.com/cloudflare/wrangler with confidence.

@gabbifish (or anyone else at Cloudflare): Do you have any news about progress/roadmap on this?

@vojkny
Copy link

vojkny commented Feb 11, 2022

🙏 this would be really helpful for CI. especially as images like avatarnewyork/wrangler are outdated

@JubbaSmail
Copy link

Adding another use case with my upvote.
Having an official Docker image for Wrangler is essential for automating our CICD system

@lisotton
Copy link

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.

@michaellwest
Copy link

Created a Docker example for Windows using Nano Server.

https://github.com/michaellwest/docker-wrangler-node

@petebacondarwin petebacondarwin transferred this issue from cloudflare/wrangler-legacy Jun 21, 2022
@petebacondarwin
Copy link
Contributor

Transferred from Wrangler 1 repo. I think there appears to still be interest in having a Docker image, even for Wrangler 2.
Notably @michaellwest's demo at https://github.com/michaellwest/docker-wrangler-node shows that it can be achieved relatively easily.
That being said, perhaps it would be enough for us to provide good CI setup examples (maybe prepackages GitHub Actions and CircleCI Orbs) instead?

@barosl
Copy link

barosl commented Jun 21, 2022

Yeah, I still want this, having been following this issue for years. As you said, it should be relatively easy to create a Dockerfile for this. Here's what I'm using personally:

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.

@penalosa penalosa added the quick win Potentially easy/straightforward issue to tackle label Sep 20, 2022
@jspspike jspspike self-assigned this Nov 29, 2022
@penalosa penalosa added the enhancement New feature or request label Feb 10, 2023
@RamIdeas
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request quick win Potentially easy/straightforward issue to tackle
Projects
Archived in project
Development

No branches or pull requests