rdagumampan / yuniql

Free and open source schema versioning and database migration made natively with .NET/6. NEW THIS MAY 2022! v1.3.15 released!
https://yuniql.io
Apache License 2.0
417 stars 63 forks source link

yuniql/yuniql:latest copy failure #303

Open Jordan466 opened 1 year ago

Jordan466 commented 1 year ago

The yuniql:latest docker image (windows os) fails to perform the COPY . ./db command Doesn't occur on the linux build

Screenshot 2023-07-08 193543

ntodorov commented 10 months ago

I've got the same error and managed to workaround it by passing extra parameter for platform: docker build --platform=linux/amd64 -t sqlserver-example .

I was following this documentation: https://yuniql.io/docs/migrate-via-docker-container/

Now it failed me when running the migrations with: docker run --rm sqlserver-example --platform sqlserver -d -a -c "<your-connection-string>" the error: docker: Error response from daemon: unable to find user ContainerUser: no matching entries in passwd file.

@Jordan466 can you try and see if you get the same as me?

ntodorov commented 10 months ago

OK more information - do not use the --platform=linux/amd64 I posted above. Seems that leads to the error i have encountered after that. I bet your docker client is also configured to use WSL so it needs linux yuniql image.

SOLUTION: change the Dockerfile 1 to:

FROM yuniql/yuniql:linux-x64-latest
COPY . ./db  

That solved it for me.

More info: If you look at docker hub, you can see how the latest tag is only linked to the Windows-based image, and not the linux one .. seems error or at least error in the documentation. I hope @rdagumampan fixes the correct place. See the docker tags: https://hub.docker.com/r/yuniql/yuniql/tags latest is to windows and you have to dig more down to see linux-x64-latest tag. I hope this helps.