I want to compile my source project with a docker container like this, at first it worked but now it's getting an error
docker: Error response from daemon: failed to create shim: OCI runtime create failed: container_linux.go:380: starting container process caused: exec: "go build -o main gitlab.org/repo/user-management/main": stat go build -o main gitlab.org/repo/user-management/main: no such file or directory: unknown.
ERRO[0022] error waiting for container: context canceled
I use jenkins to use this command
stage('Compile Source') {
steps {
sh 'docker run -v $(pwd)/:/app -w /app --name "${containerName}" golang:1.17 go build -o main gitlab.org/repo/user-management/main'
}
}
Has anyone ever compile the source code via docker container?
thank you