wader / static-ffmpeg

Multi-arch docker image with ffmpeg/ffprobe binaries built as hardened static PIE binaries with no external dependencies
https://hub.docker.com/r/mwader/static-ffmpeg/
MIT License
233 stars 56 forks source link

Add APK_OPTS build argument to set extra apk options #457

Closed timhovius closed 1 month ago

timhovius commented 1 month ago

I currently work in an organization that uses a proxy. It would be useful to be able to provide additional apk options, just like with wget

wader commented 1 month ago

Hey! good point about support proxy somehow. I wonder if using a http_proxy/HTTP_PROXY env variables might be a safer alternative as more things than apk will access the network, ex wget, git etc. But not sure if all them respect those env variables or not? at least it seems like specifying a built arg will export it:

$ echo 'FROM alpine\nRUN export\n' | docker build --build-arg http_proxy=bla --no-cache --progress=plain - 2>&1 | grep http_proxy
#5 0.069 export http_proxy='bla'

The PR for some reason, not sure if related to your change or not, fails when downloading pcre2 or ffi. Might be a indication that we should probably install those deps ourself also, feels a bit shaky.

#11 9.148 Downloading pcre2 source from https://github.com/PhilipHazel/pcre2/releases/download/pcre2-10.42/pcre2-10.42.tar.bz2
#11 10.40 Downloading pcre2 patch from https://wrapdb.mesonbuild.com/v2/pcre2_10.42-2/get_patch
#11 10.56 Cloning into 'libffi'...
#11 209.1 error: RPC failed; HTTP 502 curl 22 The requested URL returned error: 502
#11 209.1 fatal: expected 'packfile'
#11 209.1 
#11 209.1 Executing subproject pcre2 
timhovius commented 1 month ago

Hey! good point about support proxy somehow. I wonder if using a http_proxy/HTTP_PROXY env variables might be a safer alternative as more things than apk will access the network, ex wget, git etc. But not sure if all them respect those env variables or not? at least it seems like specifying a built arg will export it:

Yes you're right, but at my organization we use TLS too inspection which makes it a lot more complex. The proxy settings are respected, but I want to pass some SSL related settings too.

The PR for some reason, not sure if related to your change or not, fails when downloading pcre2 or ffi. Might be a indication that we should probably install those deps ourself also, feels a bit shaky.

#11 9.148 Downloading pcre2 source from https://github.com/PhilipHazel/pcre2/releases/download/pcre2-10.42/pcre2-10.42.tar.bz2
#11 10.40 Downloading pcre2 patch from https://wrapdb.mesonbuild.com/v2/pcre2_10.42-2/get_patch
#11 10.56 Cloning into 'libffi'...
#11 209.1 error: RPC failed; HTTP 502 curl 22 The requested URL returned error: 502
#11 209.1 fatal: expected 'packfile'
#11 209.1 
#11 209.1 Executing subproject pcre2 

Yes it's failing here too, I think this is unrelated to this PR because it wants to download a meson wrap dependency.

wader commented 1 month ago

That went better 👍 wonder if the build-arg should be documented? possible to use your use case as example?

wader commented 1 month ago

Oh there are some missing $WGET_OPTS, good catch. You can probably include them in this PR if you want.

timhovius commented 1 month ago

Oh there are some missing $WGET_OPTS, good catch. You can probably include them in this PR if you want.

I created a seperate PR #458 for this :+1:

wader commented 1 month ago

Looks good to me. Ready for merge?

There was no problem with TLS and git and cargo etc?

timhovius commented 1 month ago

Yes :+1:

timhovius commented 1 month ago

There was no problem with TLS and git and cargo etc?

I don't know, now I have some issues with meson and proxy/ssl settings.

wader commented 1 month ago

There was no problem with TLS and git and cargo etc?

I don't know, now I have some issues with meson and proxy/ssl settings.

👍 let's merge this and do separate for meson or other things you might need