Skip to content

Latest commit

 

History

History
71 lines (59 loc) · 2.11 KB

README.md

File metadata and controls

71 lines (59 loc) · 2.11 KB

go-sqlcmd docker image

Docker Docker Image Version Docker Image Size Docker Pulls GitHub License

About

Usage

# Pull image from Docker Hub
docker pull bonddim/go-sqlcmd
# Or GitHub Container Registry
docker pull ghcr.io/bonddim/go-sqlcmd

Docker container with mounted scripts to run:

docker run \
  --rm \
  -v $(pwd)/sql_scripts:/mnt/sql \
  -e SQLCMDPASSWORD={{ password }} \
  ghcr.io/bonddim/go-sqlcmd \
    -i /mnt/sql \
    -S {{ server }} \
    -d {{ database }} \
    -u {{ user }}

K8s pod with Entra ID authentication:

apiVersion: v1
kind: Pod
metadata:
  name: go-sqlcmd
  labels:
    azure.workload.identity/use: "true"
spec:
  serviceAccountName: go-sqlcmd
  containers:
  - name: go-sqlcmd
    image: bonddim/go-sqlcmd
    args: 
      - --use-aad
      - --server
      - {{ server }}.database.windows.net
      - --database-name
      - {{ database }}
      - --query
      - {{ query }}
    securityContext:
      runAsNonRoot: true
...

Refer to official docs for syntax and command line arguments

License

Inherited from microsoft/go-sqlcmd