windows下建立netcore控制台程序,然后传送到centos7下的docker容器里运行

1、首先,在window下用vs2017开发netcore控制台项目。

2、把建立好的项目传送到centos7下面的容器里。

docker cp sharefoldersforwindows/  359e:/testnetcore3

运行容器

docker exec -it 359e /bin/bash
cd testnetcore3/
cd sharefoldersforwindows/


查看文件:

-rw-r--r--. 1 root root 178 Feb 27 07:56 HelloWorld.csproj
-rw-r--r--. 1 root root 455 Feb 27 07:56 Program.cs
drwxr-xr-x. 3 root root  19 Feb 27 07:56 bin
drwxr-xr-x. 3 root root 163 Feb 27 07:56 obj

运行

[root@359ed069320e sharefoldersforwindows]# dotnet run

What is your name? 
lijie

Hello, lijie, on 02/27/2019 at 07:57!

Press any key to exit...

猜你喜欢

转载自www.cnblogs.com/25miao/p/10444349.html