【初心者】Azure上にDocker CloudからServiceを展開する方法

◆ Live配信スケジュール ◆
サイオステクノロジーでは、Microsoft MVPの武井による「わかりみの深いシリーズ」など、定期的なLive配信を行っています。
⇒ 詳細スケジュールはこちらから
⇒ 見逃してしまった方はYoutubeチャンネルをご覧ください
【5/21開催】Azure OpenAI ServiceによるRAG実装ガイドを公開しました
生成AIを活用したユースケースで最も一番熱いと言われているRAGの実装ガイドを公開しました。そのガイドの紹介をおこなうイベントです!!
https://tech-lab.connpass.com/event/315703/

はじめに

以前の記事で Docker Cloud からAzure上にNodeを作成しました。
Docker CloudとAzureを接続する

今回はこのNodeにDocker CloudからServiceを展開します。

手順

Service イメージの選択

Docker Cloudにログインします。
トップ画面の「CLEATE A SERVICE」を選択します。そして、画面右上の「Create」。
ss60

Docker Hubなども選択できますが、今回はロケットマークを選択し、「dockercloud/hello-world」を選択します。
このイメージはNGINXを実行するコンテナで、簡単なSampleページを表示します。

ss61

Service設定

そして必要な情報を入れるのですが、今回設定するのは「Ports」のみです。
「Published」にチェックを入れて、「Node port」をを80番にします。

ss63

Service の起動

画面右側の「Create & Deploy」をします。

数分待ちます



Service start failed

Timelineタブを選択すると詳細なログを確認できます。

Starting...
ERROR: hello-world-bef287ef-1: Unable to connect to the node
ERROR: Service Start action on 'hello-world-bef287ef' (using 'dockercloud/hello-world:latest') has failed

AzureのNodeが起動していなかったようです。
Nodeを起動させて再度実行します。



今度は無事「RUNNING」になりました。
ss68

ログも確認すると,successfully になってます。

Preparing to deploy...
Inspecting dockercloud/hello-world:latest image in the registry
Image up to date in our database
Deploying...
Choosing best nodes...
Candidate node 4eb79922-410c-4a15-97cc-7e2f9b4d0f63.node.dockerapp.io. State: Unreachable. Total num containers: 0. Num containers from this service: 0
Choosing node 4eb79922-410c-4a15-97cc-7e2f9b4d0f63.node.dockerapp.io because of the deployment strategy
hello-world-bef287ef-1: Deploying in 4eb79922-410c-4a15-97cc-7e2f9b4d0f63.node.dockerapp.io
hello-world-bef287ef-1: Pulling image dockercloud/hello-world:latest in 4eb79922-410c-4a15-97cc-7e2f9b4d0f63.node.dockerapp.io
hello-world-bef287ef-1: Creating in 4eb79922-410c-4a15-97cc-7e2f9b4d0f63.node.dockerapp.io with docker name hello-world-bef287ef-1.5aa20115
hello-world-bef287ef-1: Attaching container to overlay network dockercloud with ip 10.7.0.2
hello-world-bef287ef-1: Starting with docker id 377b2c1ad59db3400f5293d8ad8f780d7673e0746959f55e5ef990754ee2ae48 in 4eb79922-410c-4a15-97cc-7e2f9b4d0f63.node.dockerapp.io
hello-world-bef287ef-1: Running in 4eb79922-410c-4a15-97cc-7e2f9b4d0f63.node.dockerapp.io
Service Start action on 'hello-world-bef287ef' (using 'dockercloud/hello-world:latest') has finished successfully

ブラウザから確認

Endpointsに表示されているアドレスに実際にアクセスしてみます。
ss69

テストページが表示されました。
ss70

まとめ

Docker CloudからAzure上にServiceを簡単にデプロイすることができました。
次回はスケーリングについてなど、ご紹介できればと思います。

アバター画像
About サイオステクノロジーの中の人です 88 Articles
サイオステクノロジーで働く中の人です。
ご覧いただきありがとうございます! この投稿はお役に立ちましたか?

役に立った 役に立たなかった

0人がこの投稿は役に立ったと言っています。


ご覧いただきありがとうございます。
ブログの最新情報はSNSでも発信しております。
ぜひTwitterのフォロー&Facebookページにいいねをお願い致します!



>> 雑誌等の執筆依頼を受付しております。
   ご希望の方はお気軽にお問い合わせください!

Be the first to comment

Leave a Reply

Your email address will not be published.


*


質問はこちら 閉じる