Mssql-docker: Create custom user account on run

Created on 16 Mar 2017  路  11Comments  路  Source: microsoft/mssql-docker

From the comments section in DockerHub: https://hub.docker.com/r/microsoft/mssql-server-linux/

Create a customer user admin login with environment variables for added security.

enhancement mssql-server-linux

Most helpful comment

We still plan on adding this. Just havent gotten to it yet.

All 11 comments

FYI - We released CTP 1.4 today. This release of the mssql-server-linux image now includes the mssql-tools package (sqlcmd and bcp) in it.

Executing sqlcmd as part of the entrypoint.sh script can be used for this kind of scenario for now. Since this is such a commonplace requirement we want to make it easier in the future, but sqlcmd will provide a reasonable option until then.

Hi, I tried to use the tag CTP 1.4 but sqlcmd is not found in terminal. Thanks

Hi, I saw your demo https://github.com/twright-msft/mssql-node-docker-demo-app, and i was able to use the sqlcmd base on your guide. Maybe we could include this code in creating the docker image, in order for the sqlcmd be visible globally?
echo 'export PATH="$PATH:/opt/mssql-tools/bin"' >> ~/.bash_profile echo 'export PATH="$PATH:/opt/mssql-tools/bin"' >> ~/.bashrc source ~/.bashrc

We've run into problems in the past with conflicting file names, in particular the rather generic name 'bcp'. So, for now at least, we recommend pointing to the tools using the fully qualified path.

This is my Dockerfile for building a custom image based on the ctp1-1:

RUN apt-get update &&
apt-get install -y curl apt-transport-https &&
curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add - &&
curl https://packages.microsoft.com/config/ubuntu/16.04/prod.list | tee /etc/apt/sources.list.d/msprod.list &&
apt-get update &&
apt-get install -y mssql-tools unixodbc-dev &&
locale-gen en_US en_US.UTF-8 &&
ln -sfn /opt/mssql-tools/bin/sqlcmd* /usr/local/bin/sqlcmd &&
ln -sfn /opt/mssql-tools/bin/bcp* /usr/local/bin/bcp

OTOH, why not make the image users even easier

MySQL images, for example, are configurable allow to create extra user via environment

MYSQL_USER: joe
MYSQL_PASSWORD: pass123

Why not provide similar hook into the mssql image initialization?

I don't think anyone is looking into this issue anymore.

@pawelmaslyk They should have closed it then. @twright-msft?

We still plan on adding this. Just havent gotten to it yet.

Any update on this please

Any news on this?

Was this page helpful?
0 / 5 - 0 ratings