-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Slim Docker image no longer includes wget, so installation guide needs update #1201
Comments
@GaryGSC thanks for the comment. I guess I also need to update https://blogs.oracle.com/opal/docker-for-oracle-database-applications-in-nodejs-and-python-part-1 (and I haven't got part 2 finished yet!) |
I suggest using the ADD directive instead of using wget / curl inside the container:
|
@sosoba I read in https://docs.docker.com/develop/develop-images/dockerfile_best-practices/#add-or-copy "Because image size matters, using ADD to fetch packages from remote URLs is strongly discouraged; you should use curl or wget instead." Does your experience differ? In practice it's probably better to download Instant Client to the machine running Docker, and just add the files into the image. This way there is no repeated download cost. |
I didn't notice the difference. Maybe it's a warning against using COPY / ADD with an asterisk? BTW the best solution is mulliayer Dockerfile which "reset" layers and copy only needed files: ARG NODE_VERSION=13.8.0
FROM node:${NODE_VERSION}-stretch-slim AS build-env
ADD https://download.oracle.com/otn_software/linux/instantclient/195000/instantclient-basiclite-linux.x64-19.5.0.0.0dbru.zip /tmp/instantclient-basiclite.zip
RUN apt-get update \
&& apt-get install -y libaio1 bsdtar \
&& apt-get clean \
&& mkdir /opt/instantclient \
&& bsdtar --strip-components=1 -xvf /tmp/instantclient-basiclite.zip -C /opt/instantclient \
&& cd /opt/instantclient \
&& rm -f *jdbc* *occi* *mysql* *jar uidrvci genezi adrci libipc1.so libmql1.so
FROM node:${NODE_VERSION}-stretch-slim
COPY --from=build-env /opt/instantclient/ /opt/instantclient/
COPY --from=build-env /lib/x86_64-linux-gnu/libaio.so.1 /lib/x86_64-linux-gnu/libaio.so.1
ENV LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/instantclient |
Thanks for sharing. I had one multistage builder example in my blog post. With your Dockerfile, I'd probably make it a more generic example and use |
First off, thank you for adding the Docker section to the installation guide. It's quite helpful!
Since
wget
is no longer included innode:12-buster-slim
or any of the newest-slim
images (nodejs/docker-node#1185), this section could use a change to either installwget
or to use the full image rather thanslim
.The text was updated successfully, but these errors were encountered: