MISP / x_old_misp_docker

MISP Docker (XME edition)
283 stars 167 forks source link

Fixing issues when building behind a proxy #38

Closed V0idC0de closed 5 years ago

V0idC0de commented 5 years ago

Hello there, in order to build in an environment, which requires a HTTP proxy (i.e. our corporate environment) to download remote resources ENV http_proxy=<ProxyURI(+credentials)> ENV https_proxy=<ProxyURI(+credentials)> has to be set at the beginning of web/Dockerfile (or provided as build args).

Two lines cause problems, if this approach is used: RUN php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" This line doesn't seem to respect the environment variables mentioned above and fails to download throwing a warning. The build process fails 2 lines later, when the file is supposed to be executed (not at the download itself, as it seems to still return 0 as exit code. I suggest using curl instead, as there is no apparent reason to invoke PHP for this task (and using curl fixes the problem). RUN curl --fail --location -o composer-setup.php https://getcomposer.org/installer

RUN sudo -E apt-get -y install libpoppler58 libpoppler-dev libpoppler-cpp-dev When using http_proxy environment variables, using sudo without -E causes them to be unavailable in the following command, which results in apt-get failing. I suggest using either the -E option or switching to root for this invocation of apt-get install.

SteveClement commented 5 years ago

Makes sense, once I am at a real computer I will fix the conflict and merge the changes.

SteveClement commented 5 years ago

@TrickByte Thanks for the contributions.