Skip to content

shell behaves erratically after exiting go-sqlcmd #87

Closed
@kiilivi

Description

@kiilivi

I have tried to use go-sqlcmd in Macbook Pro M1 Docker, but it doesn't seem to be working. My Dockerfile is based on Fedora 36. This is how I installed go-sqlcmd:

RUN curl -L https://github.com/microsoft/go-sqlcmd/releases/download/v0.7.0/sqlcmd-v0.7.0-linux-arm64.tar.bz2 > sqlcmd-v0.7.0-linux-arm64.tar.bz2
RUN tar jxf sqlcmd-v0.7.0-linux-arm64.tar.bz2 -C /usr/bin
RUN rm sqlcmd-v0.7.0-linux-arm64.tar.bz2

If I run the sqlcmd command without parameters in Docker container, it exits with the following error:

unable to open tcp connection with host 'localhost:1433': dial tcp 127.0.0.1:1433: connect: connection refused

That's ok, but somehow the shell behaves erraneously after that.

If I run the sqlcmd with proper parameters, it doesn't seem to do anything. No errors, no output, but it certainly doesn't update database either. I use this kind of command:

/usr/bin/sqlcmd -S host.docker.internal -U <user> -d <database> -i <script>.sql  2>&1

I use the same command line with MacOS sqlcmd (original version, not go-sqlcmd) and it works just fine.

Is this a bug or I'm doing something wrong?

Metadata

Metadata

Assignees

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