-
Notifications
You must be signed in to change notification settings - Fork 23
/
Dockerfile.build
38 lines (30 loc) · 1.27 KB
/
Dockerfile.build
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
FROM golang:1.18
# current versions:
# https://download.oracle.com/otn_software/linux/instantclient/216000/instantclient-sdk-linux.x64-21.6.0.0.0dbru.zip
# http://www.unixodbc.org/unixODBC-2.3.11.tar.gz
ARG INSTANTCLIENT_VERSION=21_6
ARG UNIXODBC_VERSION=2.3.11
ENV LD_LIBRARY_PATH /usr/lib/instantclient_${INSTANTCLIENT_VERSION}
ENV ORACLE_HOME /usr/lib/instantclient_${INSTANTCLIENT_VERSION}
RUN apt-get update -qq && \
apt-get install -y --no-install-recommends \
libaio1 \
pkg-config
COPY ./lib/oracle/instantclient_${INSTANTCLIENT_VERSION} /usr/lib/instantclient_${INSTANTCLIENT_VERSION}
COPY ./lib/oracle/oci8.pc /usr/lib/pkgconfig/
COPY ./lib/unixODBC-${UNIXODBC_VERSION}.tar.gz /opt/
WORKDIR /opt
RUN tar xf unixODBC-${UNIXODBC_VERSION}.tar.gz
WORKDIR /opt/unixODBC-${UNIXODBC_VERSION}
RUN ./configure --disable-gui
RUN make
RUN make install
RUN echo '/usr/local/lib' >> /etc/ld.so.conf.d/x86_64-linux-gnu.conf
RUN ldconfig
RUN rm -rf /opt/unixODBC-${UNIXODBC_VERSION}*
WORKDIR /go/src/app
COPY . .
RUN mkdir -p ./cmd/sql-agent/vendor/github.com/chop-dbhi
RUN rm -rf ./cmd/sql-agent/vendor/github.com/chop-dbhi/sql-agent
RUN ln -s /go/src/app ./cmd/sql-agent/vendor/github.com/chop-dbhi/sql-agent
ENTRYPOINT go build -v -o ./dist/linux-amd64/sql-agent ./cmd/sql-agent