15 ms·
The readme compares it to the cross-architecture Cosmopolitan libc, but Docker is anything but cross-platform. On any other platform besides Linux it requires a
by pushedx 3y ago
The readme compares it to the cross-architecture Cosmopolitan libc, but Docker is anything but cross-platform. On any other platform besides Linux it requires a Linux VM.
Linux containers are great (and I run Linux as my desktop OS), just pointing out the not-so-efficient nature of considering this cross-platform.
- erik_seaberg 3y agoDoesn’t Cosmopolitan rely on QEMU to emulate an x86_64 CPU when running on any other platform?
- HumanOstrich 3y agoNo
- leonheld 3y agoNo, it doesn't. You're probably thinking of binfmt https://docs.kernel.org/admin-guide/binfmt-misc.html https://docs.kernel.org/admin-guide/binfmt-misc.html.
- erik_seaberg 3y agoWas QEMU replaced with another emulator or some kind of translation layer to run on a non-x86_64 CPU? I’m going by https://justine.lol/ape.html https://justine.lol/ape.html: > It'll be nice to know that any normal PC program we write will "just work" on Raspberry Pi and Apple ARM. All we have to do embed an ARM build of the emulator above within our x86 executables, and have them morph and re-exec appropriately, similar to how Cosmopolitan is already doing doing with qemu-x86_64, except that this wouldn't need to be installed beforehand.
- 8organicbits 3y agoI explored the idea of using the scratch image with a cosmopolitan binary to get something more cross-architecture, but you need a shell to run those binaries. I'd love to see cross architecture Docker images, if someone else can figure out a trick to make it work.
- t0astbread 3y agoI think parent was pointing out that you need Linux to run Docker (since it doesn't run natively on any other OS) which is different from what Cosmopolitan provides. Edit: Ok, apparently it natively supports Windows for Windows containers and for everything else there's a Hyper-V integration. Not sure if you can write a portable Dockerfile script like that though.
- pjmlp 3y agoYou surely can, I have Dockerfiles that do it. It is a matter of having build parameters for base images and using programming languages that are mostly OS agnostic.
- alganet 3y agoJust use redbean and provide a init lua file. Or use a http://cosmo.zip http://cosmo.zip provided interpreter (like python, maybe even bash). Each ape file is also a valid zip file. Add your dependencies as if the ape was an archive: zip -ur myape.com mydependency.anything Also add a `.args` file: zip -ur myape.com .args For this .args file, put one argument per line. This will run on start. You can use `/zip/mydepencency.anything` to read from files, but if you have an executable dependency you'll need to extract it first (I use the host shell or host powershell for this). You can do this with any software you can compile with comsocc, by adding a call to LoadZipArgs[1] in the main function. It's easy to get started, your ideas will branch out as soon as you start playing with it. [1]: https://github.com/jart/cosmopolitan/blob/master/tool/args/args.c https://github.com/jart/cosmopolitan/blob/master/tool/args/a...
- doctorpangloss 3y agoOCI image manifests can specify platforms and architectures. From the end user’s point of view it can be all the same invocation. Docker natively supports Windows, and it is low lift to make native Windows images for many common programming environments. Does anyone use it? No not really. It makes a lot of sense if you need Windows stack stuff that is superior to Linux, like DirectX, but maybe not so much for regular applications. There is also macOS containers, a project that has a decent proof of concept of a containerd fork that runs macOS container images. In principle there is a shorter path of work for so called host process containers, but fully isolated exists for macOS, it could work with e.g. Kubernetes, and people want it and it makes sense, and it sort of does exist. The difference between cross-platform and “cross-platform” as you’re talking about it is really having some absolutely gigantic company, like Amazon or Google, literally top 10 in the world, putting this stuff into a social media zeitgeist.
- tomjen3 3y agoThe main problem, I think, with Windows containers is that they are only really supported on Windows Server - which most developers don't have access to. You can run them through Docker Desktop, but then why not just run the same containers you will be deploying on you server (which is most likely going to be linux based?). I would love for MS to make containers the way to deploy programs to Windows, but that requires them to make the runtime part of the default install and to make it available on all the OSs.
- doctorpangloss 3y agoWindows 2022 containers work on Windows 11. Docker Desktop uses a shim for Windows containers. “dockerd” a single binary for Windows statically compiled is all you need to run Windows containers with the familiar Docker commands, you could also use PowerShell. They are supported all the same. IMO the main issue is that this feature is poorly marketed.
- tomjen3 3y agoIts extremely poorly marketed, since I looked up the MS documentation when I wrote that comment and it only still only said windows server. Still unless it works on Win10 home, it won't be the default way to install software for windows - which sucks, since its a better way than the current one.
- riffic 3y agothat's not necessarily true
- deleted 3y ago[deleted]
- adastra22 3y agoDoesn’t windows use WSL?
- voxic11 3y agoNot for windows containers. But no one really uses those anyways.
- pjmlp 3y agoWe use them. Many Windows products, e.g. Sitecore, only support Windows containers. Microsoft Store software relies on Windows containers infrastructure. Windows containers make use of Windows jobs APIs.
- chx 3y agoDocker Desktop runs either with Hyper-V or with WSL. https://docs.docker.com/desktop/install/windows-install/ https://docs.docker.com/desktop/install/windows-install/
- ric2b 3y agoWSL is a Linux VM
- pjmlp 3y agoNot on Windows when using Windows containers.
- deleted 3y ago[deleted]
- Arch-TK 3y agoNot to mention the non-standard -S flag to env which makes the shebang work.
- willio58 3y agoMakes me wonder if containerization is even possible without a VM for non-Linux machines.
- edgyquant 3y agoI do believe so but only for the host OS. Eg Mac containers work for Mac etc
- shepherdjerred 3y agohttps://macoscontainers.org https://macoscontainers.org