<p>I want to connect to Azure SQL Server from my container deployed on Azure kubernetes, especially using sqlcmd.</p>
<p>Something similar to this</p>
<p><a href="https://i.stack.imgur.com/E7c09.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/E7c09.png" alt="enter image description here" /></a></p>
<p>How do I install sqlcmd in openjdk docker image? should I also need to install .Net Framework on the docker image?</p>

One Developer
<p>here is what i am using</p>
<pre><code>ARG UBUNTU_VERSION=18.04
FROM ubuntu:$UBUNTU_VERSION

ARG MSSQLTOOLS_VERSION=17.4.1.1-1
ENV PATH=/opt/mssql-tools/bin:$PATH

RUN apt-get update \
    &amp;&amp; apt-get install -y curl apt-transport-https locales gnupg2 \
    &amp;&amp; locale-gen &quot;en_US.UTF-8&quot; \
    &amp;&amp; export `grep &quot;VERSION_ID&quot; /etc/os-release | sed -e 's/^VERSION_ID=\&quot;/VERSION_ID=/' -e 's/\&quot;$//'` \
    &amp;&amp; curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add - \
    &amp;&amp; curl https://packages.microsoft.com/config/ubuntu/$VERSION_ID/prod.list | tee /etc/apt/sources.list.d/msprod.list \
    &amp;&amp; apt-get update \
    &amp;&amp; ACCEPT_EULA=Y apt-get install -y mssql-tools=$MSSQLTOOLS_VERSION unixodbc-dev \
    &amp;&amp; apt-get remove -y curl apt-transport-https \
    &amp;&amp; rm -f /etc/apt/sources.list.d/msprod.list \
    &amp;&amp; rm -rf /var/lib/apt/lists/*

## should be set after locale was generated, overwise triggers warnings
ENV LANG=&quot;en_US.UTF-8&quot; LANGUAGE=&quot;en_US.UTF-8&quot; LC_ALL=&quot;en_US.UTF-8&quot;

ENTRYPOINT [&quot;sqlcmd&quot;]
</code></pre>
<p><a href="https://github.com/fabiang/docker-sqlcmd/blob/master/Dockerfile" rel="nofollow noreferrer">https://github.com/fabiang/docker-sqlcmd/blob/master/Dockerfile</a></p>
