docker-alpine icon indicating copy to clipboard operation
docker-alpine copied to clipboard

Please provide docker images with alpine-sdk already installed

Open gebi opened this issue 7 years ago • 7 comments

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?

gebi avatar Jun 10 '17 15:06 gebi

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?

andyshinn avatar Jun 10 '17 18:06 andyshinn

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.

gebi avatar Jun 13 '17 11:06 gebi

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.

ncopa avatar Jun 13 '17 12:06 ncopa

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.

LaurentGoderre avatar Apr 04 '18 15:04 LaurentGoderre

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?

jucardi avatar May 20 '18 06:05 jucardi

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)

gebi avatar Jan 18 '19 21:01 gebi

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.

tianon avatar Jan 19 '19 02:01 tianon