Commit 929abe8d authored by YINAN's avatar YINAN

增加sqlserver

parents
apiVersion: v1
name: beagle-sqlserver-2017
version: 1.0.0
appVersion: 2017
description: sqlserver Database
\ No newline at end of file
How to use this Image
Start a mssql-server instance using the CU8 release IMPORTANT NOTE: If you are using PowerShell on Windows to run these commands use double quotes instead of single quotes.
docker run -e 'ACCEPT_EULA=Y' -e 'SA_PASSWORD=yourStrong(!)Password' -e 'MSSQL_PID=Enterprise' -p 1433:1433 -d registry.ispacesys.cn/public/sqlserver-ee:2017
Connect to Microsoft SQL Server You can connect to the SQL Server using the sqlcmd tool inside of the container by using the following command on the host:
docker exec -it <container_id|container_name> /opt/mssql-tools/bin/sqlcmd -S localhost -U sa -P <your_password>
You can also use the tools in an entrypoint.sh script to do things like create databases or logins, attach databases, import data, or other setup tasks. See this example of using an entrypoint.sh script to create a database and schema and bcp in some data.
You can connect to the SQL Server instance in the container from outside the container by using various command line and GUI tools on the host or remote computers. See the Connect and Query topic in the SQL Server on Linux documentation.
Configuration
Requirements
This image requires Docker Engine 1.8+ in any of their supported platforms.
At least 2GB of RAM (3.25 GB prior to 2017-CU2). Make sure to assign enough memory to the Docker VM if you're running on Docker for Mac or Windows.
Requires the following environment flags
ACCEPT_EULA=Y
SA_PASSWORD=<your_strong_password>
MSSQL_PID=<your_product_id | edition_name> (default: Developer)
A strong system administrator (SA) password: At least 8 characters including uppercase, lowercase letters, base-10 digits and/or non-alphanumeric symbols.
Environment Variables
You can use environment variables to configure SQL Server on Linux Containers.
ACCEPT_EULA confirms your acceptance of the End-User Licensing Agreement.
SA_PASSWORD is the database system administrator (userid = 'sa') password used to connect to SQL Server once the container is running. Important note: This password needs to include at least 8 characters of at least three of these four categories: uppercase letters, lowercase letters, numbers and non-alphanumeric symbols.
MSSQL_PID is the Product ID (PID) or Edition that the container will run with. Acceptable values:
Developer : This will run the container using the Developer Edition (this is the default if no MSSQL_PID environment variable is supplied)
Express : This will run the container using the Express Edition
Standard : This will run the container using the Standard Edition
Enterprise : This will run the container using the Enterprise Edition
EnterpriseCore : This will run the container using the Enterprise Edition Core <valid product id> : This will run the container with the edition that is associated with the PID
For a complete list of environment variables that can be used, refer to the documentation here.
\ No newline at end of file
logo.png

41.5 KB

configInfo:
- name: image
text: 镜像
type: text
value: "registry.ispacesys.cn/public/sqlserver-ee"
- name: tag
text: 版本
type: radio
value: ["2017"]
- name: storageSpec.volumeClaimTemplate.spec.storageClassName
text: 存储类
type: radio
value: ["rook-ceph-block"]
- name: storageSpec.volumeClaimTemplate.spec.resources.requests.storage
text: 存储容量
type: text
value: "5Gi"
\ No newline at end of file
{{/* vim: set filetype=mustache: */}}
{{/*
Expand the name of the chart.
*/}}
{{- define "sqlserver.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{/* Helm required labels */}}
{{- define "sqlserver.labels" -}}
heritage: {{ .Release.Service }}
release: {{ .Release.Name }}
chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
{{- end -}}
{{/* matchLabels */}}
{{- define "sqlserver.matchLabels" -}}
release: {{ .Release.Name }}
{{- end -}}
\ No newline at end of file
apiVersion: v1
kind: Service
metadata:
name: {{ .Release.Name }}
namespace: {{ .Release.Namespace }}
labels:
{{ include "sqlserver.labels" . | indent 4 }}
app: sqlserver
spec:
ports:
- name: sqlserver
port: 1433
selector:
{{ include "sqlserver.matchLabels" . | indent 4 }}
app: sqlserver
\ No newline at end of file
apiVersion: apps/v1beta2
kind: StatefulSet
metadata:
name: {{ .Release.Name }}
namespace: {{ .Release.Namespace }}
labels:
{{ include "sqlserver.labels" . | indent 4 }}
app: sqlserver
version: "{{ .Values.tag }}"
spec:
replicas: 1
serviceName: {{ .Release.Name }}
selector:
matchLabels:
{{ include "sqlserver.matchLabels" . | indent 6 }}
app: sqlserver
template:
metadata:
labels:
{{ include "sqlserver.labels" . | indent 8 }}
app: sqlserver
version: "{{ .Values.tag }}"
spec:
nodeSelector:
{{ toYaml $.Values.nodeSelector | indent 8 }}
initContainers:
- name: "remove-lost-found"
image: {{ .Values.busybox.image }}:{{ .Values.busybox.tag }}
command: ["rm", "-Rf", "/opt/lost+found"]
volumeMounts:
- name: data
mountPath: /opt
- name: init-data
image: {{ .Values.busybox.image }}:{{ .Values.busybox.tag }}
command:
- "chown"
- "-R"
- "999:999"
- "/opt"
volumeMounts:
- name: data
mountPath: /opt
containers:
- name: sqlserver
image: "{{ .Values.image }}:{{ .Values.tag }}"
imagePullPolicy: IfNotPresent
ports:
- containerPort: 1433
env:
- name: SA_PASSWORD
value: "{{ .Values.password }}"
- name: ACCEPT_EULA
value: "Y"
- name: MSSQL_PID
value: "Enterprise"
volumeMounts:
- name: data
mountPath: /opt
- name: localtime
mountPath: /etc/localtime
volumes:
- name: localtime
hostPath:
path: /etc/localtime
{{- if .Values.storageSpec.hostPath }}
- name: data
hostPath:
{{ toYaml $.Values.storageSpec.hostPath | indent 10 }}
{{- else if .Values.storageSpec.volumeClaimTemplate }}
volumeClaimTemplates:
- metadata:
name: "data"
labels:
{{ include "sqlserver.labels" . | indent 8 }}
app: {{ .Release.Name }}
spec:
{{ toYaml $.Values.storageSpec.volumeClaimTemplate.spec | indent 6 }}
{{- else }}
- name: data
emptyDir: {}
{{- end }}
\ No newline at end of file
image: "registry.ispacesys.cn/public/sqlserver-ee"
tag: "2017"
password: "Sqlserver@2017"
nodeSelector: {}
storageSpec:
volumeClaimTemplate:
spec:
storageClassName: rook-ceph-block
accessModes: ["ReadWriteOnce"]
resources:
requests:
storage: 5Gi
selector: {}
busybox:
image: registry-vpc.cn-qingdao.aliyuncs.com/wod/busybox
tag: 1.29
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment