LoginSignup
15
18

More than 5 years have passed since last update.

Vagrant+Amazon Linux

Last updated at Posted at 2017-05-10

最新のAmazonLinuxのboxを持ってくる(Virtualbox Only)

vagrant init mvbcoding/awslinux
vagrant up --provider virtualbox

指定のバージョンをboxに追加してそれを使う

vagrant box add amzn-linux-2017.03 https://atlas.hashicorp.com/mvbcoding/boxes/awslinux/versions/2017.03.0.20170401/providers/virtualbox.box

AWS EC2 に AmazonLinux を起動してプロキシを起動

上記のみだと、AmazonLinux向けのRPMレポジトリが参照できないので、yumをプロキシするためにAWS上にAmazonLinuxのEC2を適当に起動して、tinyproxy を起動します
※ tinyproxyのデフォルトポートは 8888 です、 アクセス元のIPとかセキュリティグループで制限しておいた方がいいです

tinyproxy を EC2(AmazonLinux) へインストール

sudo yum -y install epel-release.noarch
sudo yum -y install --enablerepo=epel tinyproxy
sudo service tinyproxy start

Vagrant上のyum.confへプロキシ設定追加

echo 'proxy=http://<AWS EC2 IP ADDR>:8088' >> /etc/yum.conf

参考

15
18
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
15
18