Code Monkey home page Code Monkey logo

ms-sqlserver-docker's Introduction

ms-sqlserver-docker

Configures Microsoft's SQL Server Docker image with default mount bindings that map to external drives for data and log file usage.

Installation

Prior to building the image and creating the container, ensure the following:

  • All Docker files are in the same directory.
  • One has valid permissions to the (external) volumes they plan to mount to the container.
  • Docker Compose is installed--included when using Docker Desktop.

Usage

Simply run the following command in a terminal session that's mapped to the directory where the files have been cloned to build the image and create the container in detach mode.

$ docker compose -f mssql-compose.yml up --build -d
  • Use the .env file to edit yaml variables.
  • By default the external port is set to 1001; therefore change this port if one plans to run multiple containers in the same (local) network.
  • One can use a different image tag for the feature_tag_name variable provided by Microsoft's Docker Hub repository found at this link: https://hub.docker.com/_/microsoft-mssql-server/
  • Use the following file path syntax for mounting external volumes:
    • Windows - "D:\\Path\\To\\Folder"
    • Linux - /mnt/d/path/to/folder
  • Connect Microsoft's SQL Server Management Studio to the containerized database with the following UI inputs:
    • NOTE:
      • 1001 is the (default) port number and thus one has to change that value if different than what's assigned to the port_values variable.
      • Password is what has been assigned to the variable, MSSQL_SA_PASSWORD. image

Features

  • Maps (4) seperate external volume bind mounts for the following directores:
    • User created database log files (.ldf).
    • User created database files (.mdf).
    • The default (/var/opt/mssql/data) location for system database and log files.
    • The default (/var/backups) location for database backups.
  • NOTE: The user created database directory and its respective log file directory--for the MS SQL Server container--are created when the image is being built.
  • Automatically sets the default locations of these directory mounts in MS SQL Server's .conf file when building the (Docker) image.

Etcetera

  • Validated to work in Docker Desktop v4.26.1 on Windows 11 Professional, Version 22H2 (OS Build 22621.3007)
  • Container runs with user mssql (non-root privelage) and the working directory is /var/opt/mssql.
    • To enter the running container as a root user, execute the following in a terminal:
      • $ docker exec -itu root container-name sh
  • For more Microsoft recommended configuration tips, refer to their documentation link: https://learn.microsoft.com/en-us/sql/linux/sql-server-linux-configure-mssql-conf?view=sql-server-ver15

ms-sqlserver-docker's People

Contributors

ghostmach avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.