Skip to content

Provide Docker image via registry #574

Open

Description

As of #153 the docker image is being provided via Github Release Page, which is not optimal

Previous mssql-tools are correctly released: https://hub.docker.com/r/microsoft/mssql-tools

New go-sqlcmd docker image is expected to be correctly tagged on a registry, being it Dockerhub or Microsoft's own MCR https://mcr.microsoft.com

Current workaround provided by third-party:
https://github.com/fabiang/docker-sqlcmd

Activity

  1. CappyT commented on Apr 15, 2025

    @CappyT

    Using a third party is an unacceptable solution in contexts where container security is taken into account. Please provide official images for official tools.

  2. dedo1911 commented on Jul 9, 2025

    @dedo1911
    Author

    For now, we’ve opted to build and host our own non-root image in our private registry.

    Since version v1.7.0 (released in June 2024), Docker images are no longer published in the GitHub releases. As a result, the latest available official container image is now over a year old.

    This was previously addressed in #153, but it seems the release process has since been reverted, and no recent builds are available.

    Here’s the Dockerfile we’re using to build a minimal, non-root container based on the latest tag:

    FROM golang:1 AS builder
    RUN git clone https://github.com/microsoft/go-sqlcmd.git && \
        cd go-sqlcmd && \
        git checkout $(git tag --sort=version:refname | tail -n 1) && \
        CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build \
            -o /sqlcmd \
            -ldflags="-X main.version=$(git tag --sort=version:refname | tail -n 1)" \
            ./cmd/modern
    
    FROM gcr.io/distroless/static:nonroot
    COPY --from=builder /sqlcmd /sqlcmd
    USER 1002
    ENTRYPOINT ["/sqlcmd"]

    We hope this helps others with similar needs until official container builds are available again.

    CC: David Shiflet (@shueybubbles) Stuart Padley (@stuartpa) — tagging in case this context is useful or if there’s interest in restoring the Docker image publishing process.

  3. bonddim commented on Oct 21, 2025

    @bonddim

    Meanwhile, my solution with non-root image and without binary rebuilding
    https://github.com/bonddim/go-sqlcmd

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions