Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

docker build go project failed [duplicate]

Tags:

docker

go

https://github.com/shuimuliang/qnmahjongserver

I tried to build a golang project with Docker. I have followed the steps from this project and successfully build the project by go build -o qnmahjong . But when I run docker build -t qnmahjong . It gives me error: "docker buildx build" requires exactly 1 argument. I am not sure is that the output file is invalid or the docker command does not treat the output file as 1 argument.

like image 567
Anson Chan Avatar asked Dec 05 '25 10:12

Anson Chan


1 Answers

Replace docker build -t qnmahjong with docker build -t qnmahjong .

You are missing the "." The dot means you use the Dockerfile in the local directory

This will create a Docker image named qnmahjong based on the instructions in the Dockerfile. You can then run the image using the following command:

docker run qnmahjong 
like image 168
Vishwa Ratna Avatar answered Dec 07 '25 23:12

Vishwa Ratna



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!