{"description":"Development environment to have all tools necessary in one place.","short_description":"Development environment to have all tools necessary in one place.","name":"nfqlt/docker","versions":[{"version":"2023-10-16","status":"active","description_html":"
This vagrant box has preinstalled and preconfigured docker and other tools for\n web development using nfqlt docker images.
\n\n$box = "nfqlt/docker"\n$ip = "10.24.0.2"\n$subnet = "10.24.0.0/16"\n$network = "hostonly"\n$box_url = ""\n\nif Process.uid == 0\n puts "\\e[1;31m" + "Error, 'vagrant' command is not allowed to run as root!" + "\\e[0m\\n"\n exit(false)\nend\n\n$name = $box.split("/")[1]\nif RUBY_PLATFORM =~ /darwin/ && system("vboxmanage --version | grep -vq '^6.'"); $network = "hostonlynet" end\n\nVagrant.configure("2") do |config|\n config.trigger.before :up do |trigger|\n trigger.ruby do\n if ! system("grep -q '^* #{$subnet}' /etc/vbox/networks.conf")\n puts "\\e[1;33m" + "Adding the #{$subnet} network to the /etc/vbox/networks.conf file..." + "\\e[0m\\n"\n system("sudo bash -c \\"mkdir -p /etc/vbox; echo '* #{$subnet}' >> /etc/vbox/networks.conf\\"")\n end\n end\n end\n\n if ! $box_url.empty? && system("curl -s #{$box_url} 2> /dev/null | grep -q #{$box}"); config.vm.box_url = $box_url end\n\n config.vm.box = $box\n config.ssh.username = "project"\n config.ssh.forward_x11 = true\n config.ssh.shell = "bash"\n config.vm.network "private_network", ip: $ip, netmask: $subnet.split("/")[1]\n\n config.vm.provider "virtualbox" do |vbox|\n vbox.name = $name\n vbox.customize ["modifyvm", :id, "--cpus", 4]\n vbox.customize ["modifyvm", :id, "--memory", "6144"]\n vbox.customize ["modifyvm", :id, "--name", $name]\n vbox.customize ["modifyvm", :id, "--audio", "none"]\n vbox.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]\n vbox.customize ["modifyvm", :id, "--nic1", "nat"]\n vbox.customize ["modifyvm", :id, "--nictype1", "virtio"]\n vbox.customize ["modifyvm", :id, "--nic2", $network]\n vbox.customize ["modifyvm", :id, "--nictype2", "virtio"]\n vbox.customize ["modifyvm", :id, "--nicpromisc2", "allow-all"]\n vbox.customize ["setextradata", :id, "--VBoxInternal2/SharedFoldersEnableSymlinksCreate/v-root", "1"]\n vbox.customize ["guestproperty", "set", :id, "/VirtualBox/GuestAdd/VBoxService/--timesync-set-threshold", 500]\n end\n\n config.vm.provision "shell", keep_color: true, inline: "/root/scripts/bootstrap.sh '" + $name + "' '" + $ip + "'"\n config.vm.provision "shell", keep_color: true, inline: "/root/scripts/networking.sh", run: "always"\nend\n
\n\nNOTE: remove Vagrant vbguest plugin to speedup vagrant startup about 15 times.
\n\nVagrantfile
in some empty directory and paste an example content from above.ssh-keygen -t rsa -m PEM -b 4096 -N ""
and follow instructions)vagrant up
in the VM directory (there Vagrantfile resides).smb://10.24.0.2/projects
to local file system. You can use 'map network\ndrive' feature to ease your pain. User/pass should be project/project
.\nUse drive letter K:
, this is needed for various helper tools.sudo mount 10.24.0.2:/home/project/projects SOME-LOCAL-DIR
command.\n\nsudo apt-get install nfs-common
sudo umount SOME-LOCAL-DIR
and mount again in\nthat casesudo mount -t nfs -o vers=3 10.24.0.2:/home/project/projects SOME-LOCAL-DIR
unison
server runing on the VM for bi-directional file sync.vagrant ssh
or manually accessing project@10.24.0.2 via putty\nshould get you logged into VM with no password required. Make sure your ssh\nclient uses same private key as you copied in step 2.NOTE: Physically files resides inside virtual machine, so they are removed\npermanently if you destroy a virtual machine. Dont forget to commit\nand push all your changes before stopping VM with vagrant destroy
VM_GIT_USER_NAME='John Smith'\nVM_GIT_USER_EMAIL='john.smith@nfq.lt'\nVM_LDAP_LOGIN='jsmith'\nVM_GITHUB_TOKEN='token_is_optional_but_MUST_BE_VALID'\nVM_DOCKERHUB_LOGIN=""\nVM_DOCKERHUB_PASSWORD=""\nVM_DOCKERHUB_NFQ_LOGIN=""\nVM_DOCKERHUB_NFQ_PASSWORD=""\n
\n\nIn case you want to customize your shell, for example add some aliases - you\ncan do it by creating file named bash_custom right next to your vm.cfg.\nThis file gets loaded by ~/.bashrc every time you login to your VM.
\n\nvagrant destroy
command in the VM-NAME directory.vagrant box remove nfqlt/docker
command.vagrant up
. Note, new base\nbox image will be downloaded from server.Default user/password: project/project
\n\nvagrant ssh
or other ssh client of\nyour choice: ssh -Y 10.24.0.2
cd ~/projects
and here you could find your projects. To make them appear\nhere you need to put some script/command into bash_custom file so that it \nclones repo with your docker-compose.yml files into ~/projects
dir.docker-compose up
command. All output\nwill be directed to your terminal.git commit && git push
right away.sudo resize2fs /dev/sdb 60G
inside VM. Make sure\nhost has enough free space, otherwise VM gets corrupted beyond redemption.vagrant up
gives error Failed to create the host-only adapter
\n\nProgress state: NS_ERROR_FAILURE\nVBoxManage: error: Failed to create the host-only adapter\nVBoxManage: error: VBoxNetAdpCtl: Error while adding new interface: VBoxNetAdpCtl: ioctl failed for /dev/vboxnetctl: Inappropriate ioctl for devic\nVBoxManage: error: Details: code NS_ERROR_FAILURE (0x80004005), component HostNetworkInterface, interface IHostNetworkInterface\nVBoxManage: error: Context: "int handleCreate(HandlerArg*, int, int*)" at line 66 of file VBoxManageHostonly.cpp\n
\nIn case you have just installed virtualbox and not yet rebooted your\nmachine you need to load vbox kernel modules either via modprobe or\nrestarting virtualbox service or simply rebooting your machine.