lwthiker / curl-impersonate

curl-impersonate: A special build of curl that can impersonate Chrome & Firefox
MIT License
3.46k stars 229 forks source link

"lwthiker/curl-impersonate:0.5.1-ff" is built using Alpine, not Debian #93

Closed wrobelda closed 1 year ago

wrobelda commented 1 year ago

It seems that something is potentially off with your generate_dockerfiles.sh script, as the non-Alpine images are, in fact, also Alpine:

cromo@docker:~/rss-bridge/rss-bridge$ sudo docker run -it lwthiker/curl-impersonate:0.5.1-ff sh
/ # apk
apk-tools 2.12.7, compiled for x86_64.

usage: apk [<OPTIONS>...] COMMAND [<ARGUMENTS>...]

Package installation and removal:
  add        Add packages to WORLD and commit changes
  del        Remove packages from WORLD and commit changes

System maintenance:
  fix        Fix, reinstall or upgrade packages without modifying WORLD
  update     Update repository indexes
  upgrade    Install upgrades available from repositories
  cache      Manage the local package cache

Querying package information:
  info       Give detailed information about packages or repositories
  list       List packages matching a pattern or other criteria
  dot        Render dependencies as graphviz graphs
  policy     Show repository policy for packages
  search     Search for packages by name or description

Repository maintenance:
  index      Create repository index file from packages
  fetch      Download packages from global repositories to a local directory
  manifest   Show checksums of package contents
  verify     Verify package integrity and signature

Miscellaneous:
  audit      Audit system for changes
  stats      Show statistics about repositories and installations
  version    Compare package versions or perform tests on version strings

This apk has coffee making abilities.
lwthiker commented 1 year ago

The Docker images on Docker Hub are intentionally Alpine-based to reduce the size to a minimum. It is also explicitly stated in the README file:

Docker images based on Alpine Linux with curl-impersonate compiled and ready to use are available on Docker Hub.

Is there a need in your project for Debian-based Docker images on Docker Hub as well? You could also use the pre-compiled binaries which might be simpler.

wrobelda commented 1 year ago

The Docker images on Docker Hub are intentionally Alpine-based to reduce the size to a minimum. It is also explicitly stated in the README file:

Docker images based on Alpine Linux with curl-impersonate compiled and ready to use are available on Docker Hub.

OK, but in this case the tags on Docker Hub are kinda misleading, as you publish 0.5-ff-alpine alongside 0.5-ff, both of which are the same, whereas one could assume the latter is actually debian (like I did).

Is there a need in your project for Debian-based Docker images on Docker Hub as well? You could also use the pre-compiled binaries which might be simpler.

Indeed, they are useful for docker multi-stage builds, where other stage (or stages) use Debian-based images as well.

Have a look at this particular case I am working on: https://github.com/RSS-Bridge/rss-bridge/pull/2941.

Alpine uses musl in place of libc, so after copying the binaries/libs over to the Debian-based image, they fail to run. I could apt add musl in debian image, but that in turn requires additional symlinking to match the musl.so originally linked against (which musl debian package doesn't do), which, as you can guess, quickly becomes rather dirty/hacky and an additional maintenance burden, e.g. for when musl.so symlink gets updated. EDIT: not even sure if that would work, i.e. to have libraries compiled against different C stdlibs loaded by the same process...

The multi-staging build appears to me be the easiest and cleanest way to replace curl with curl-impersonate in any image, since it can take care of matching the architectures automatically. Actually downloading your pre-compiled binaries into the image is not easier IMHO, as it requires handling that very aspect by hand — which BTW wouldn't be possible now, anyway, since you also don't publish them for arm. my bad, I see that you do offer arm64 binaries.

lwthiker commented 1 year ago

There are now Debian-based images on Docker Hub as well. Please note that the previous tags still point to the Alpine Linux images. The Debian tags are suffixed with -slim-buster, e.g.: 0.5.2-chrome-slim-buster, 0.5.2-ff-slim-buster

wrobelda commented 1 year ago

Thank you, much appreciated!