-
Notifications
You must be signed in to change notification settings - Fork 38
Expand file tree
/
Copy pathDockerfile
More file actions
73 lines (59 loc) · 2.26 KB
/
Dockerfile
File metadata and controls
73 lines (59 loc) · 2.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
FROM perl:stable-slim-bookworm
ARG ORA2PG_VERSION=25.0
ARG ORA_VERSION=19.26
ARG ORA_VERSION_POST=0.0.0-1.el8
# ugly fix for "update-alternatives" missing directories in slim image
RUN mkdir -p /usr/share/man/man1 &&\
mkdir -p /usr/share/man/man7
RUN apt-get update && apt-get install -y -q --no-install-recommends \
cpanminus \
unzip \
curl \
ca-certificates \
rpm \
alien \
libaio1 \
# Install postgresql
postgresql-client \
# Install mysql
libdbd-mysql \
# Install Perl Database Interface
libdbi-perl \
bzip2 \
libpq-dev \
gnupg2 \
libdbd-pg-perl
ADD /assets /assets
# Install Oracle Client
RUN mkdir /usr/lib/oracle/$ORA_VERSION/client64/network/admin -p
RUN arch=$(rpm --eval '%{_arch}') && \
alien -i "/assets/oracle-instantclient$ORA_VERSION-basic-$ORA_VERSION.$ORA_VERSION_POST.${arch}.rpm" && \
alien -i "/assets/oracle-instantclient$ORA_VERSION-devel-$ORA_VERSION.$ORA_VERSION_POST.${arch}.rpm" && \
alien -i "/assets/oracle-instantclient$ORA_VERSION-sqlplus-$ORA_VERSION.$ORA_VERSION_POST.${arch}.rpm"
ENV ORACLE_HOME=/usr/lib/oracle/$ORA_VERSION/client64
ENV TNS_ADMIN=/usr/lib/oracle/$ORA_VERSION/client64/network/admin
ENV LD_LIBRARY_PATH=/usr/lib/oracle/$ORA_VERSION/client64/lib
ENV PATH=$PATH:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/lib/oracle/$ORA_VERSION/client64/bin
# Install DBI module with Postgres, Oracle and Compress::Zlib module
RUN cpan install Test::NoWarnings &&\
cpan install DBI &&\
cpan install DBD::Pg &&\
cpan install Bundle::Compress::Zlib &&\
cpanm install DBD::Oracle@1.82
# Install ora2pg
RUN curl -L -o /tmp/ora2pg.zip https://github.com/darold/ora2pg/archive/v$ORA2PG_VERSION.zip &&\
(cd /tmp && unzip ora2pg.zip && rm -f ora2pg.zip) &&\
mv /tmp/ora2pg* /tmp/ora2pg &&\
(cd /tmp/ora2pg && perl Makefile.PL && make && make install)
# config directory
RUN mkdir /config
RUN cp /etc/ora2pg/ora2pg.conf.dist /etc/ora2pg/ora2pg.conf.backup &&\
cp /etc/ora2pg/ora2pg.conf.dist /config/ora2pg.conf
VOLUME /config
# output directory
RUN mkdir /data
VOLUME /data
ADD entrypoint.sh /usr/bin/entrypoint.sh
WORKDIR /
ENTRYPOINT ["entrypoint.sh"]
CMD ["ora2pg"]