Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

jsamaniegog's avatar

Laravel Sail behind a proxy, a headache

For the "sail up" command behind the proxy to work for me, I had to change the Dockerfile like this:

...
ARG HTTP_PROXY
ARG HTTPS_PROXY
...
RUN echo "Acquire::http::Proxy \"$HTTP_PROXY\";" >> /etc/apt/apt.conf
RUN echo "Acquire::https::Proxy \"$HTTPS_PROXY\";" >> /etc/apt/apt.conf
...
&& apt-key adv --homedir ~/.gnupg --keyserver hkp://keyserver.ubuntu.com:80 --keyserver-options http-proxy=$HTTP_PROXY --recv-keys E5267A6C \
    && apt-key adv --homedir ~/.gnupg --keyserver hkp://keyserver.ubuntu.com:80 --keyserver-options http-proxy=$HTTP_PROXY --recv-keys C300EE8C \
...

Is there a way to make this easier?

Thank you.

0 likes
1 reply
Tray2's avatar

You can always try editing your hosts file and adding the url there.

Please or to participate in this conversation.