在Docker容器(Ubuntu)的Windows中创建的Run Go应用程序

I created very simple application that put to output some text.

My development environment is Windows + Docker for Windows. I created ubuntu container and after build my application in Windows for ubuntu

set GOARCH=amd64
set GOOS=linux
go build -o "myapp"

Then I copy 'myapp' file to shared folder and see it in shared folder of my container. After I try to run it inside container but there is an error

enter image description here

Why can't I run it? Was it built incorrectly or do I try to execute it in some wrong way?

In windows I have this output when I run my exe file and I want something the same in Ubuntu.

enter image description here

UPDATE As suggested I try ./myapp and there is Exec format error

enter image description here

查看全部
douyao1878
douyao1878
2017/02/09 08:12
  • ubuntu
  • docker
  • 点赞
  • 收藏
  • 回答
    私信
满意答案
查看全部

1个回复