2019-12-14 04:13:31 +00:00
|
|
|
FROM mono:latest AS build
|
2018-10-18 19:46:33 +00:00
|
|
|
|
2022-07-13 22:22:38 +00:00
|
|
|
ARG TARGETPLATFORM
|
|
|
|
|
2019-12-14 04:13:31 +00:00
|
|
|
RUN apt-get update && \
|
|
|
|
apt-get install -y unixodbc
|
2018-10-18 19:46:33 +00:00
|
|
|
|
2019-12-14 04:13:31 +00:00
|
|
|
WORKDIR /build
|
|
|
|
ADD https://dev.mysql.com/get/Downloads/Connector-ODBC/8.0/mysql-connector-odbc-8.0.18-linux-debian9-x86-64bit.tar.gz /build
|
2022-07-13 22:22:38 +00:00
|
|
|
RUN if [ "$TARGETPLATFORM" = "linux/amd64" ]; then \
|
|
|
|
tar zxf mysql-connector-odbc-8.0.18-linux-debian9-x86-64bit.tar.gz && \
|
2019-12-14 04:13:31 +00:00
|
|
|
mkdir -p /usr/lib/odbc/ && \
|
|
|
|
cp mysql-connector-odbc-8.0.18-linux-debian9-x86-64bit/lib/* /usr/lib/odbc/ && \
|
2022-07-13 22:22:38 +00:00
|
|
|
mysql-connector-odbc-8.0.18-linux-debian9-x86-64bit/bin/myodbc-installer -d -a -n "MySQL" -t "DRIVER=/usr/lib/odbc/libmyodbc8w.so"; \
|
|
|
|
else \
|
|
|
|
mkdir -p /usr/lib/odbc/ && \
|
|
|
|
touch /etc/odbcinst.ini; \
|
|
|
|
fi
|
2019-12-14 04:13:31 +00:00
|
|
|
|
|
|
|
COPY . .
|
2018-10-18 19:46:33 +00:00
|
|
|
RUN nuget restore /build/OmniLinkBridge.sln
|
|
|
|
RUN msbuild /build/OmniLinkBridge.sln /t:Build /p:Configuration=Release
|
|
|
|
RUN mv /build/OmniLinkBridge/bin/Release /app
|
|
|
|
|
2019-12-14 04:13:31 +00:00
|
|
|
FROM mono:latest AS runtime
|
2018-10-18 19:46:33 +00:00
|
|
|
|
2019-12-14 04:13:31 +00:00
|
|
|
RUN apt-get update && \
|
|
|
|
apt-get install -y unixodbc
|
2018-10-18 19:46:33 +00:00
|
|
|
|
2019-12-14 04:13:31 +00:00
|
|
|
COPY --from=build /usr/lib/odbc /usr/lib/odbc
|
|
|
|
COPY --from=build /etc/odbcinst.ini /etc/odbcinst.ini
|
2019-12-24 02:23:43 +00:00
|
|
|
COPY --from=build /app/OmniLinkBridge.ini /config/OmniLinkBridge.ini
|
2018-10-18 19:46:33 +00:00
|
|
|
|
2019-12-14 04:13:31 +00:00
|
|
|
EXPOSE 8000/tcp
|
|
|
|
VOLUME /config
|
|
|
|
WORKDIR /app
|
|
|
|
COPY --from=build /app .
|
2020-01-06 02:34:03 +00:00
|
|
|
CMD [ "mono", "OmniLinkBridge.exe", "-i", "-c", "/config/OmniLinkBridge.ini", "-e", "-s", "/config/WebSubscriptions.json", "-lf", "disable" ]
|