0

I have a dockerfile and docker-compose that works fine on Intel and/or AMD based chips, but there are some issues when it's expected to build on a M1 Apple Silicon chip.

It follows the errors:

#6 12.11 Reading state information... #6 12.16 E: Unable to locate package msodbcsql17 #6 12.16 E: Unable to locate package mssql-toolsexecutor failed running [/bin/sh -c apt-get update && apt-get install -y --no-install-recommends apt-transport-https ca-certificates gnupg && curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add - && curl https://packages.microsoft.com/config/ubuntu/18.04/prod.list > /etc/apt/sources.list.d/mssql-release.list && apt-get update && ACCEPT_EULA=Y apt-get install -y --no-install-recommends msodbcsql17 mssql-tools unixodbc-dev && echo 'export PATH="$PATH:/opt/mssql-tools/bin"' >> ~/.bash_profile && echo 'export PATH="$PATH:/opt/mssql-tools/bin"' >> ~/.bashrc && apt-get -y autoremove && rm -rf /var/lib/apt/lists/*]: exit code: 100 ERROR: Service 'laravel-app' failed to build : Build failed

What can I do to run it properly?

Felipe Novaes
  • 73
  • 1
  • 5
  • Is your base container actually Ubuntu 18.04? There are different prod.list URLs and .apk/.rpm files for each different distribution (and version). REF: [Install the Microsoft ODBC driver for SQL Server (Linux)](https://learn.microsoft.com/en-us/sql/connect/odbc/linux-mac/installing-the-microsoft-odbc-driver-for-sql-server) – AlwaysLearning Jun 25 '21 at 03:43
  • Hi @AlwaysLearning, the base container is Ubuntu 18.04 currently :D I'm gonna check this link you've sent me, thanks. – Felipe Novaes Jun 25 '21 at 13:01
  • After checking this link I could solve this issue adding: echo msodbcsql17 msodbcsql/ACCEPT_EULA boolean true | sudo debconf-set-selections – Felipe Novaes Jun 25 '21 at 20:39

1 Answers1

0

@AlwaysLearning provided a good link which helped me solving this issue.

Just added the following line:

echo msodbcsql17 msodbcsql/ACCEPT_EULA boolean true | sudo debconf-set-selections

And after that I had some issues that leads me to finding another solution by searching on the web. While in the "installing sql for PHP" step I've added this following line too (As M1 is also Unix based, it needs to be used):

apt-get install unixodbc-dev

Felipe Novaes
  • 73
  • 1
  • 5