Closed SutharMukesh closed 4 years ago
Do you need it with 19.03 or 18.03 will be okay for you? I saw oracle has changed some stuff for 19.03
okay, will try creating with 18.03.
I'm having the same issue :( Sadly, I have no idea how to fix this hehe. I tried to follow Oracle's own readme but it didn't work.
@luisrudge this problem for some reason comes with oracle client 19.03.
I suggest you to download 18.03, use a COPY command to place it in docker container and build it.
If you want me to do it, please create a new issue, thank you.
Thanks, I ended up using a multistep docker file
FROM oraclelinux:7-slim as builder
#Instant Client Version
ARG release=19
ARG update=6
RUN yum -y install oracle-release-el7
RUN yum-config-manager --enable ol7_oracle_instantclient
RUN yum -y install oracle-instantclient${release}.${update}-basiclite
RUN rm -rf /usr/lib/oracle/${release}.${update}/client64/bin
WORKDIR /usr/lib/oracle/${release}.${update}/client64/lib/
RUN rm -rf *jdbc* *occi* *mysql* *jar
# Get a new image
FROM node:12-buster-slim
# Copy the Instant Client libraries, licenses and config file from the previous image
COPY --from=builder /usr/lib/oracle /usr/lib/oracle
COPY --from=builder /usr/share/oracle /usr/share/oracle
COPY --from=builder /etc/ld.so.conf.d/oracle-instantclient.conf /etc/ld.so.conf.d/oracle-instantclient.conf
RUN apt-get update && apt-get -y upgrade && apt-get -y dist-upgrade && apt-get install -y libaio1 && \
apt-get -y autoremove && apt-get -y clean && \
ldconfig && \
npm i -g nodemon
# Create app directory
WORKDIR /usr/src/app
# Copy the .js files from your host machine into the new app directory
ADD ./ ./
CMD ["node", "index.js"]
Looks good @luisrudge . What is size of your image now?
REPOSITORY TAG IMAGE ID CREATED SIZE
testoracle latest 85c3bda1413e 4 seconds ago 301MB
@luisrudge not bad. i wanted alpine badly due to it's size
@Shrinidhikulkarni7 what's your image's size?
If I change to alpine, I save only 80mb
FROM oraclelinux:7-slim as builder
#Instant Client Version
ARG release=19
ARG update=6
RUN yum -y install oracle-release-el7
RUN yum-config-manager --enable ol7_oracle_instantclient
RUN yum -y install oracle-instantclient${release}.${update}-basiclite
RUN rm -rf /usr/lib/oracle/${release}.${update}/client64/bin
WORKDIR /usr/lib/oracle/${release}.${update}/client64/lib/
RUN rm -rf *jdbc* *occi* *mysql* *jar
# Get a new image
FROM node:12-alpine
# Copy the Instant Client libraries, licenses and config file from the previous image
COPY --from=builder /usr/lib/oracle /usr/lib/oracle
COPY --from=builder /usr/share/oracle /usr/share/oracle
COPY --from=builder /etc/ld.so.conf.d/oracle-instantclient.conf /etc/ld.so.conf.d/oracle-instantclient.conf
RUN wget -q -O /etc/apk/keys/sgerrand.rsa.pub https://alpine-pkgs.sgerrand.com/sgerrand.rsa.pub && \
wget https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.31-r0/glibc-2.31-r0.apk && \
apk add glibc-2.31-r0.apk && \
apk add libaio
# Create app directory
WORKDIR /usr/src/app
# Copy the .js files from your host machine into the new app directory
ADD ./ ./
CMD ["node", "index.js"]
testoracle latest 32f81cbd905c 8 seconds ago 228MB
This repo looks promising to reduce image size significantly, I haven't tried it yet.
Hi there, I am currently trying to dockerize my REST API server written in nodejs which requires oracle client. my application works with base image jessie but takes alot of size, so I was trying to build the image on alpine, I came across your repo which offers oracle client on the alpine image.
I'm stuck with an error, would appreciate if you may look into it.
Dockerfile