「.NET 開発基盤部会 Wiki」は、「Open棟梁Project」,「OSSコンソーシアム .NET開発基盤部会」によって運営されています。
ココの手順は、全て、Ubuntu18.04 LTSで行っています。
以下のように接続する(CMD等から接続)。
ssh -i <秘密キーのパス> AzureUser@xxx.xxx.xxx.xxx
ssh AzureUser@xxx.xxx.xxx.xxx
※ Azureの接続のSSHタブを参照するなど(AzureUser?は既定のアカウント名)。
$ sudo apt update $ sudo apt upgrade -y $ sudo apt autoremove -y $ sudo apt autoclean -y $ sudo reboot
※ 再接続
$ sudo timedatectl set-timezone Asia/Tokyo
$ sudo apt install -y language-pack-ja-base language-pack-ja ibus-mozc fonts-takao-pgothic fonts-takao-gothic fonts-takao-mincho $ sudo localectl set-locale LANG=ja_JP.UTF-8 LANGUAGE="ja_JP:ja" $ source /etc/default/locale
$ sudo dpkg-reconfigure keyboard-configuration
$ sudo apt update
$ sudo apt -y install xfce4gdm3とlightdmの選択画面が
$ sudo apt install xfce4-session
$ sudo apt -y install xrdp
$ sudo systemctl enable xrdp
$ echo xfce4-session >~/.xsession
$ sudo vi /etc/xrdp/xrdp.ini
port=3389 ←ここの数値を任意のポートに変更
$ sudo service xrdp restart
$ sudo passwd <現在のユーザー名>
>az vm open-port --resource-group <rgName> --name <vmName> --port <ポート番号>
標準でインストールされている。
$ sudo apt install geany
$ sudo wget --no-check-certificate https://dl-ssl.google.com/linux/linux_signing_key.pub $ sudo apt-key add linux_signing_key.pub $ sudo sh -c 'echo "deb http://dl.google.com/linux/chrome/deb/ stable main " >> /etc/apt/sources.list' $ sudo apt update $ sudo apt install -y google-chrome-stable
$ sudo apt install git
$ dpkg -l git
$ git config --global user.name [任意のユーザ名] $ git config --global user.email [任意のユーザ名]
$ sudo apt update
$ sudo apt install \ apt-transport-https \ ca-certificates \ curl \ gnupg-agent \ software-properties-common
$ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
$ sudo add-apt-repository \ "deb [arch=amd64] https://download.docker.com/linux/ubuntu \ $(lsb_release -cs) \ stable"
$ sudo apt update
$ sudo apt install -y docker-ce
$ docker ...
$ whoami AzureUser $ docker ps Got permission denied while...
$ cat /etc/group | grep docker docker:x:999:
sudo gpasswd -a AzureUser docker
$ cat /etc/group | grep docker docker:x:999:AzureUser
$ sudo chmod 666 /var/run/docker.sock
$ docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
export compose='1.26.0'
$ sudo curl -L https://github.com/docker/compose/releases/download/${compose}/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose
$ sudo chmod 0755 /usr/local/bin/docker-compose
$ docker-compose -v docker-compose version 1.26.0, build d4451659
$ sudo apt install nodejs -y $ sudo apt install npm -y
$ npm -v 3.5.2 $node -v v8.10.0
sudo npm install n -g
$ sudo n stable
$ sudo apt purge -y nodejs npm
$ npm -v 6.14.5 $node -v v12.18.1
$ curl -L -o vscode.deb https://go.microsoft.com/fwlink/?LinkID=760868 $ sudo apt install -y ./vscode.deb
wget https://packages.microsoft.com/config/ubuntu/18.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb sudo dpkg -i packages-microsoft-prod.deb
sudo apt-get update; \ sudo apt-get install -y apt-transport-https && \ sudo apt-get update && \ sudo apt-get install -y dotnet-sdk-3.1
sudo apt-get update; \ sudo apt-get install -y apt-transport-https && \ sudo apt-get update && \ sudo apt-get install -y aspnetcore-runtime-3.1
が動くかどうか?
Readmeの手順を、そのまま、
Linux VM上で実行してみた。
...ボチボチ動くっぽい。
version: '3.4' services: webapplication1: image: ${DOCKER_REGISTRY-}webapplication1 build: context: . dockerfile: WebApplication1/Dockerfile ports: - "5000:5000"
public static IWebHost BuildWebHost(string[] args) => WebHost.CreateDefaultBuilder(args) .UseStartup<Startup>() .UseUrls("http://0.0.0.0:5000/") .Build();
Unable to start Kestrel.
$ sudo apt install unzip
unzip WebApplication1.zip
docker-compose up -d
$ docker-compose up --build -d
>dotnet new mvc The template "ASP.NET Core Web App (Model-View-Controller)" was created successfully. This template contains technologies from parties other than Microsoft, see https://aka.ms/aspnetcore/3.1-third-party-notices for details. Processing post-creation actions... Running 'dotnet restore' on C:\Users\nishi\source\repos\WebApplication1\WebApplication1.csproj... C:\Users\nishi\source\repos\WebApplication1\WebApplication1.csproj の復元が 172.54 ms で完了しました。
>dotnet run info: Microsoft.Hosting.Lifetime[0] Now listening on: https://localhost:5001 info: Microsoft.Hosting.Lifetime[0] Now listening on: http://localhost:5000 info: Microsoft.Hosting.Lifetime[0] Application started. Press Ctrl+C to shut down. info: Microsoft.Hosting.Lifetime[0] Hosting environment: Development info: Microsoft.Hosting.Lifetime[0] Content root path: C:\Users\nishi\source\repos\WebApplication1 info: Microsoft.Hosting.Lifetime[0] Application is shutting down...
To customize Run and Debug [create a launch.json file].
Unable to start Kestrel.の問題のために、そのままでは、dotnet run できない。
public static void Main(string[] args) { CreateHostBuilder(args).Build().Run(); } public static IHostBuilder CreateHostBuilder(string[] args) => Host.CreateDefaultBuilder(args) .ConfigureWebHostDefaults(webBuilder => { webBuilder.UseStartup<Startup>() .UseUrls("http://0.0.0.0:5000/"); });
Ubuntu18.04 LTS以降
sshd_config: A new version (/tmp/filehV7Xqu) of configuration file /etc/ssh/sshd_config is available, but the version installed currently has been locally modified.
keep the local version currently installed
変更はなさそう。
ubuntu-ja-18.04.3-desktop-amd64.iso を取得。