以下のVagrantfileを使用して、bookmarksがインストールされた仮想マシンを構築する事ができます。
仮想マシン構築後、ブラウザからhttp://192.168.55.103:5000/にアクセスします。
Vagrantfile
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "bento/ubuntu-16.04"
config.vm.hostname = "ub1604bookmarks"
config.vm.provider :virtualbox do |vbox|
vbox.name = "ub1604bookmarks"
vbox.cpus = 2
vbox.memory = 2048
vbox.customize ["modifyvm", :id, "--nicpromisc2","allow-all"]
end
config.vm.network "private_network", ip: "192.168.55.103", :netmask => "255.255.255.0"
config.vm.network "public_network", ip:"192.168.1.103", :netmask => "255.255.255.0"
config.vm.provision "shell", inline: <<-SHELL
# update packages
apt-get update
#DEBIAN_FRONTEND=noninteractive apt-get -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" upgrade
locale-gen ja_JP.UTF-8
localectl set-locale LANG=ja_JP.UTF-8
# install java
apt-get -y install openjdk-8-jdk
# install bookmarks
mkdir -p /opt/bookmarks
cd /opt/bookmarks
wget https://unpkg.com/dyu-bookmarks@0.4.1/bin/bookmarks-linux-standalone-x64.tar.gz
tar -xzf bookmarks-linux-standalone-x64.tar.gz
cat << EOF > /etc/systemd/system/bookmarks.service
[Unit]
Description=bookmarks
Requires=network.target
After=network.target
[Service]
Type=simple
WorkingDirectory=/opt/bookmarks
ExecStart=/opt/bookmarks/start.sh
[Install]
WantedBy=multi-user.target
EOF
systemctl enable bookmarks.service
systemctl start bookmarks.service
echo 'access http://192.168.55.103:5000/'
SHELL
end
〇bookmarksの画面
0 件のコメント:
コメントを投稿