Skip to content

Instantly share code, notes, and snippets.

@umit
Created December 19, 2017 14:41
Show Gist options
  • Save umit/fbb31495ae74387f2d4a2ffcadf17148 to your computer and use it in GitHub Desktop.
Save umit/fbb31495ae74387f2d4a2ffcadf17148 to your computer and use it in GitHub Desktop.
Docker hosts fix
COPY orig-hosts /tmp/orig-hosts
RUN cp /etc/hosts /tmp/hosts && \
mkdir -p -- /lib-override && cp /lib64/libnss_files.so.2 /lib-override && \
sed -i 's:/etc/hosts:/tmp/hosts:g' /lib-override/libnss_files.so.2 && \
chmod 755 /tmp/hosts && \
chown java:java /tmp/hosts
ENV LD_LIBRARY_PATH /lib-override
RUN cat /tmp/orig-hosts >> /tmp/hosts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment