GithubHelp home page GithubHelp logo

Comments (6)

evanw avatar evanw commented on May 4, 2024 2

I'm only using npm as a distribution mechanism. There's nothing about nodejs that's inherently necessary to run esbuild. For example, this is all it takes to get an esbuild binary on Linux:

$ curl -O https://registry.npmjs.org/esbuild-linux-64/-/esbuild-linux-64-0.0.9.tgz
$ tar xf ./esbuild-linux-64-0.0.9.tgz
$ file ./package/bin/esbuild
package/bin/esbuild: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), statically linked, not stripped
$ ./package/bin/esbuild

Usage:
  esbuild [options] [entry points]

...

Given that it's this simple, it seems like overkill to me to use docker just to run esbuild. It also seems pretty simple to use these commands to create a docker image if you do need one, so it doesn't seem necessary to me to have an official docker image. That said, I don't use docker myself, so I could be misunderstanding something.

from esbuild.

sarkiroka avatar sarkiroka commented on May 4, 2024 1

And what about the CI/CD servers? We need to install nodejs and npm instead of docker? Please think about docker container again. It has many many advantage. This is an important aspect in my devops hat.

from esbuild.

evanw avatar evanw commented on May 4, 2024

Thanks for the idea. However, I am planning to solve this problem by instead making a single npm package for all platforms with a post install script that automatically downloads the correct binary (see #32).

from esbuild.

icfantv avatar icfantv commented on May 4, 2024

@evanw I think the underlying issue will be that a lot of corporate CI systems are locked down to the Internet so using npm install or yarn install will fail. Additionally, corporate ITSEC might need to be, ahem, persuaded, to allow a foreign binary into, say, an Artifactory server.

One of our product teams is evaluating this for their product to see how/if it's viable. If it is, either us building a Docker image wrapping this or having the ability to build eslint locally the first time prior to use in a CI environment would be very useful.

If you don't want to mess with supporting the latter (and I'm still going through the existing issues so I don't know if you've already addressed this use-case elsewhere), I'm happy to investigate the Docker route if we decide that we want to use this internally and share that if it's useful.

Thoughts?

from esbuild.

evanw avatar evanw commented on May 4, 2024

Running esbuild using Docker should work fine. I haven't tried it myself but I don't see why it wouldn't work. I don't intend for this to be the distribution method for esbuild but it should be trivial to do this yourself if you need it.

The instructions for installing a binary without needing to install node or npm are in my previous post. If you want to build from source because you don't trust the binary, you could do this:

$ git clone --depth 1 --branch v0.0.0 https://github.com/evanw/esbuild.git
$ cd esbuild
$ go build "-ldflags=-s -w" ./cmd/esbuild

except you would replace 0.0.0 with the version of esbuild you intend to build. These commands result in an executable file called ./esbuild in the current working directory.

from esbuild.

icfantv avatar icfantv commented on May 4, 2024

Agreed. We run all our Ansible and Helm stuff from containers to keep the versions stable and not have to deal with all the inherent versioning issues on dev computers. A dev on one of our app teams is currently evaluating this. I think Docker will be the way we decide to go if we decide to switch away from Webpack. Thanks again.

from esbuild.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.