Apple Silicon M1 + docker

1.6k views Asked by At

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?

1

There are 1 answers

0
Felipe Novaes On BEST ANSWER

@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