Docker Community Forums

Share and learn in the Docker community.

Check building on or local machine, and execute corresponding code


(Eromoe) #1


I am in China, I need create a docker image with custom apt-get source ,pip source and so on.? (Because of GFW in China, default source is usually unreachable or very very slow )

I write a Dockfile here

Local building is fine, but can not build on for a long time, detail
Looks like some network error.

I only want to use one Dockerfile to support Local building and dockerhub host. So is there any way to check if building in or local and execute corresponding code? Such as, when build in, update source at last .

(Sam) #2

write a shell script that can figure out the host issuing the build request and do the extra work when required