1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Win10Home+Vagrant+Ubuntu+golangで go get github.com/my/repos 覚え書き(ついでにdockerとnodebrewとdep)

Last updated at Posted at 2018-07-11

はじめに

自分用のメモですが、誰かの目に留まって助けになればうれしいです。

手順

VirtualBoxVagrantをインストール

いい感じのところにDirを切って移動 mkdir yourDir && cd yourDir

Vagrant CloudからタグがVagrantのUbuntuを選択する(今回はUbuntu16なのでxenial64)

vagrant init Ubuntu/xenial64 後、vagrantfileの config.vm.network "forwarded_port", guest: 80, host: 8080config.vm.network "private_network", ip: "192.168.33.10" のコメントアウトを外しておく

vagrant up !! (しばし休憩)

sudo apt-get update
sudo apt-get upgrade
sudo apt-get install -y apt-transport-https ca-certificates curl software-properties-common
sudo apt-get install -y golang
sudo apt-get upgrade -y git
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo apt-key fingerprint 0EBFCD88
sudo apt-get install -y docker-ce

ここで一回 exit して vagrant ssh

sudo curl -sL https://github.com/docker/compose/releases/download/1.21.2/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
sudo mkdir -p ~/go; echo "export GOPATH=$HOME/go" >> ~/.bashrc
sudo chown vagrant.vagrant -R /home/vagrant/go

もう一度 exit vagrant ssh
この記事のとおりにkey生成と登録をおこなう

cd ~/go
mkdir bin
curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
vim ~/.profile
[.profile]
PATH="$HOME/bin:$HOME/.local/bin:$HOME/go/bin:$HOME/.nodebrew/current/bin:$PATH"

追加して再度 exit vagrant ssh

curl -L git.io/nodebrew | perl - setup
nodebrew install v10
nodebrew use v10
go get github.com/your/repos
cd ~/go/src/github.com/your/repos
dep ensure

参考

https://github.com/hironeko/virtual_environment_for_beginner
http://jnst.hateblo.jp/entry/2016/10/17/210612
https://github.com/golang/dep
https://github.com/hokaccha/nodebrew

最後に

効率が悪かったり、間違っている箇所があるかと思います。
もしよろしければ、ご指摘とご教授よろしくお願いいたします。

1
0
0

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
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?