forked from pacman82/odbc-api
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
55 lines (45 loc) · 2.77 KB
/
Dockerfile
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
# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.163.1/containers/debian/.devcontainer/base.Dockerfile
# [Choice] Debian version: buster, stretch
ARG VARIANT="buster"
FROM mcr.microsoft.com/vscode/devcontainers/base:0-${VARIANT}
# Install Microsoft ODBC SQL Drivers (msodbcsql17 package) for Debian 10
# https://docs.microsoft.com/de-de/sql/connect/odbc/linux-mac/installing-the-microsoft-odbc-driver-for-sql-server?view=sql-server-ver15
RUN curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add -
RUN curl https://packages.microsoft.com/config/debian/10/prod.list > /etc/apt/sources.list.d/mssql-release.list
RUN echo msodbcsql17 msodbcsql/ACCEPT_EULA boolean true | debconf-set-selections
# Add buster backports to source list (required for Maria DB ODBC driver)
#
# Turns out this package ships with to old a driver. Leave this in for reference still.
#
# RUN echo "deb http://deb.debian.org/debian buster-backports main" >> /etc/apt/sources.list
# This section to installs additional packages.
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
&& apt-get -y install --no-install-recommends \
build-essential \
unixodbc-dev \
msodbcsql17 \
# odbc-mariadb/buster-backports \
sqlite3 \
libsqliteodbc \
odbc-postgresql
# Fix SQLite driver paths
RUN sed --in-place 's/libsqlite3odbc.so/\/usr\/lib\/x86_64-linux-gnu\/odbc\/libsqlite3odbc.so/' /etc/odbcinst.ini
RUN sed --in-place 's/libsqliteodbc.so/\/usr\/lib\/x86_64-linux-gnu\/odbc\/libsqliteodbc.so/' /etc/odbcinst.ini
# Fix PostgreSQL driver paths
RUN sed --in-place 's/psqlodbca.so/\/usr\/lib\/x86_64-linux-gnu\/odbc\/psqlodbca.so/' /etc/odbcinst.ini
RUN sed --in-place 's/psqlodbcw.so/\/usr\/lib\/x86_64-linux-gnu\/odbc\/psqlodbcw.so/' /etc/odbcinst.ini
# Install MariaDB driver from tar bundle
COPY docker/mariadb-connector-odbc-3.1.15-debian-buster-amd64.tar.gz .
COPY docker/mariadb_odbc_template.ini .
RUN tar -xf mariadb-connector-odbc-3.1.15-debian-buster-amd64.tar.gz
RUN cp mariadb-connector-odbc-3.1.15-debian-buster-amd64/lib/mariadb/libmaodbc.so /usr/lib/x86_64-linux-gnu/odbc/libmaodbc.so
RUN cp mariadb-connector-odbc-3.1.15-debian-buster-amd64/lib/mariadb/libmariadb.so.3 /usr/lib/x86_64-linux-gnu/
RUN odbcinst -i -d -f mariadb_odbc_template.ini
# There is also a rust devcontainer, yet this way we get a toolchain
# which is updatable with rustup.
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- --default-toolchain stable -y
# Setup workspace
WORKDIR /workspace
COPY . .
RUN cp odbcsv/tests/list-drivers-linux.txt odbcsv/tests/list-drivers.txt
CMD ~/.cargo/bin/cargo test --release & ~/.cargo/bin/cargo test --release --features narrow & ~/.cargo/bin/cargo test --release --features odbc_version_3_5