docker-alpine
docker-alpine copied to clipboard
Please provide docker images with alpine-sdk already installed
Hi,
I've seen it frequently that people pull alpine only to install alpine-sdk as the first action every time.
It would be nice to have -dev versions of alpine on docker hub, eg. 3.6-dev, latest-dev with alpine-sdk already installed.
Or do i get something terrible wrong and this is solved in another way?
I'm not really sure about this. I can't recall ever having to install alpine-sdk
. What is it for? If you are generally doing development you probably have your own set of requirements in addition to alpine-sdk
which probably warrants creating your own development base image.
Is there a scenario where you would only need alpine-sdk
and not need to build your own image?
It seems to me like the bigger brother of apt-get install build-essential
from debian.
From most smaller packages i've compiled alpine-sdk was enough to make it work, but you are right, for anything bigger additional packages would be needed anyway.
alpine-sdk
depends on the tools for buildling alpine itself, including tools to generate iso image. You will normally not need that in a docker image. What you probably mean is build-base
which corresponds better with debians build-essential
.
However, you will normally only need this during build, but not for the final runtime. To save space, you will want install the build deps, build the thing, and then uninstall the build deps (but keep the runtime deps), in the same RUN
.
We could of course create an image with the build-base
install, but I don't think it makes much sense.
Sorry to revive this old thread but I think this is particularly relevant now with multistage builds. It would speed up builds to have an image that contains all the build tools already installed.
not sure why this is an issue, why can't you build your own alpine based image with the sdk installed and upload it to your hub?
Thats exactly my suggestion (albeit alpine-dev with build-base would be more appropriate)... If everyone creates it's own alpine base image with sdk installed it would produce an multiplication of alpine versions with some dev packages installed where ONE base image with the base dev packages installed from alpine itself would save both time and ressources on all sides! (that's what my idea was all about)
It would speed up builds to have an image that contains all the build tools already installed.
See https://github.com/docker-library/golang/issues/250#issuecomment-451201761 for where I've done some comparisons to try and verify this point (in that example, the package being installed is git
, but I'm sure it translates well to the build-base
package too).
I've re-done those tests now with build-base
, and the result of time apk add --no-cache build-base
with all my intermediate cache disabled is ~5.6s and downloads ~55MiB (~165MiB on-disk extracted size reported by apk
).
So honestly, I think RUN apk add --no-cache build-base
will probably be faster in many cases than downloading a Docker image layer that contains those bits.