on my M1 MacbookPro I have created a Dockerfile below:
FROM ubuntu:20.10
RUN apt-get update
RUN apt-get install -y curl gnupg2
RUN curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add -
RUN curl https://packages.microsoft.com/config/ubuntu/20.10/prod.list > /etc/apt/sources.list.d/mssql-release.list
RUN exit
RUN apt-get update
RUN ACCEPT_EULA=Y apt-get install -y msodbcsql17
RUN ACCEPT_EULA=Y apt-get install -y mssql-tools
RUN echo 'export PATH="$PATH:/opt/mssql-tools/bin"' >> ~/.bashrc
RUN source ~/.bashrc
It uses the Ubuntu 20.10 image, and attempts to install Microsoft's ODBC Driver. I have followed the commands as per Microsoft's documentation.
When I run a build, I get an error Unable to locate package msodbcsql17. I have tried running and SSHing into the container and I still get the same error.
% docker build .
[+] Building 5.3s (11/14)
=> [internal] load build definition from Dockerfile 0.4s
=> => transferring dockerfile: 37B 0.0s
=> [internal] load .dockerignore 0.5s
=> => transferring context: 2B 0.0s
=> [internal] load metadata for docker.io/library/ubuntu:20.10 2.8s
=> [ 1/11] FROM docker.io/library/ubuntu:20.10@sha256:6b603b0f3b8fc71b1a97bd38e081e8df04793f1447362c12385b48106aaded3f 0.0s
=> CACHED [ 2/11] RUN apt-get update 0.0s
=> CACHED [ 3/11] RUN apt-get install -y curl gnupg2 0.0s
=> CACHED [ 4/11] RUN curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add - 0.0s
=> CACHED [ 5/11] RUN curl https://packages.microsoft.com/config/ubuntu/20.10/prod.list > /etc/apt/sources.list.d/mssql-release.list 0.0s
=> CACHED [ 6/11] RUN exit 0.0s
=> CACHED [ 7/11] RUN apt-get update 0.0s
=> ERROR [ 8/11] RUN ACCEPT_EULA=Y apt-get install -y msodbcsql17 1.8s
------
> [ 8/11] RUN ACCEPT_EULA=Y apt-get install -y msodbcsql17:
#11 0.893 Reading package lists...
#11 1.278 Building dependency tree...
#11 1.347 Reading state information...
#11 1.394 E: Unable to locate package msodbcsql17
------
executor failed running [/bin/sh -c ACCEPT_EULA=Y apt-get install -y msodbcsql17]: exit code: 100