3 ms·
I'm curious if Docker is a build-time or run-time dependency on Linux. I tried to pick apart the Linux build script, but it's pretty complicated.
by CGamesPlay 12y ago
I'm curious if Docker is a build-time or run-time dependency on Linux. I tried to pick apart the Linux build script, but it's pretty complicated.
- FooBarWidget 12y agoBuilt time only. Docker is only used by the Traveling Ruby authors (i.e. Phusion and contributors) for building the binaries. You, as a Ruby developer who just wants to distribute your app, just uses the binaries that we have already built and uploaded somewhere. There is no need for you to run Docker. On Linux, Docker is used to provide a controlled, isolated build environment. In other words, it serves as a "holy build box" (https://github.com/phusion/traveling-ruby#why-it-is-difficult-to-supply-a-precompiled-ruby-interpreter-that-works-for-all-end-users https://github.com/phusion/traveling-ruby#why-it-is-difficul...). There is no native Docker for OS X (i.e. a Docker which can run OS X binaries) so on OS X we try to get as close to an isolated, controlled build environment as we can by setting various environment variables (https://github.com/phusion/traveling-ruby/blob/master/osx/internal/reset_environment.sh https://github.com/phusion/traveling-ruby/blob/master/osx/in...), but it's not perfect and I'm sure someone will have just the right amount of Homebrew libraries to interfere with it. The build scripts are pretty simple. It needs more documentation, but here's the gist: - setup-docker-container - builds a Docker container which will function as an isolated build environment. Only need to do this once. - setup-runtime - builds a runtime which is used inside the Docker container. Builds mock chroots and stuff. Only need to do this once. The only reason why this exists is because of limitations in Docker. - build - builds Ruby binaries, given a runtime directory. It spawns a Docker container which performs the actual building. Inside the Docker container, it invokes the compiler, copies stuff around, etc. Just follow the hello world tutorial and you'll see how it works.