LoginSignup
2

More than 5 years have passed since last update.

RaspberryPi 2にSnappy Ubuntu Coreを入れて色々試してみる

Posted at

RaspberryPi2にSnappy Ubuntu Coreを入れてdockerがインストール出来なかったショックから一夜、こいつにも何かできる事はあるんじゃないかと色々触ってみた。

まずは公式にあるチュートリアルを参考に、webserverを探してみる。

ubuntu@localhost:~$ snappy search webserver

Part                       Version  Description
go-example-webserver  1.0.4    Minimal Golang webserver for snappy
xkcd-webserver        0.3.1    Show random XKCD compic via a build-in webserver

xkcd-webserver

試しにxkcd-webserverをインストール。

ubuntu@localhost:~$ sudo snappy install xkcd-webserver

xkcd-webserver     21 kB     [=====================================================================================================================================================================================================]    OK    
Part            Tag   Installed  Available  Fingerprint     Active  
xkcd-webserver  edge  0.3.1      -          3a9152b8bff494  *    

インストールが完了したら既に起動しているので、PCからアクセス。

2.png

これだけ...

Golang Server

今度こそはとGo言語のWebサーバーをインストールしてみる。

ubuntu@localhost:~$ sudo snappy install go-example-webserver

go-example-webserver      3 MB     [===============================================================================================================================================================================================]    OK    
Part                  Tag   Installed  Available  Fingerprint     Active  
go-example-webserver  edge  1.0.4      -          74c86cd4ed154a  *    

今度はport8081で起動しているようなので、ポート番号をアクセスしてみると...

3.png

動いた!(HelloWorldだけど...)
表示されているファイルの実態は/apps/go-example-webserver/current/main.goらしい。
GO触ったことないけどコレを書き換えてもダメなんですね。コンパイルが必要なのかと思ったけどgoコマンドは使えないし、どうしたらいいんだろう...

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2