Skip to content

Instantly share code, notes, and snippets.

@mgwalker
Created December 15, 2020 15:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mgwalker/74baf8a7fa77062c31170029884d098d to your computer and use it in GitHub Desktop.
Save mgwalker/74baf8a7fa77062c31170029884d098d to your computer and use it in GitHub Desktop.
ora2pg dockerfile
FROM ubuntu
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \
alien \
git \
libdbi-perl \
wget \
&& rm -rf /var/lib/apt/lists/*
RUN wget https://download.oracle.com/otn_software/linux/instantclient/211000/oracle-instantclient-basic-21.1.0.0.0-1.x86_64.rpm
RUN alien oracle-instantclient-basic-21.1.0.0.0-1.x86_64.rpm
RUN git clone https://github.com/darold/ora2pg.git /ora2pg
WORKDIR /ora2pg
# Pin to a known commit
RUN git checkout 13b9693
RUN perl Makefile.PL
RUN make && make install
RUN mv /etc/ora2pg/ora2pg.conf.dist /etc/ora2pg/ora2pg.conf
RUN mkdir /project
WORKDIR /project
ENV ORACLE_HOME /usr/lib/oracle/21.1/client64
CMD ora2pg
@mgwalker
Copy link
Author

If you're in a directory with an Oracle DDL file and want to convert that file to PostgreSQL, pull down this Dockerfile and then run these commands to build and run it:

docker build -t ora2pg .
docker run --rm -v "$(pwd):/project" ora2pg ora2pg --input <oracle-ddl.sql>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment