Différences
Ci-dessous, les différences entre deux révisions de la page.
Les deux révisions précédentes Révision précédente Prochaine révision | Révision précédente | ||
premiers_pas_avec_vagrant [2022/10/20 22:17] – [Lancer le projet Vagrant] ps | premiers_pas_avec_vagrant [2023/04/24 13:59] (Version actuelle) – [Vagrant - - Utilisation de base] ps | ||
---|---|---|---|
Ligne 7: | Ligne 7: | ||
===== Vagrant - Installation ===== | ===== Vagrant - Installation ===== | ||
+ | * voir également ici : https:// | ||
===== Vagrant - - Utilisation de base ===== | ===== Vagrant - - Utilisation de base ===== | ||
Toutes les actions se réfèrent à la machine (**box**) décrite dans la **Vagrantfile** | Toutes les actions se réfèrent à la machine (**box**) décrite dans la **Vagrantfile** | ||
+ | |||
+ | Ici, une **Vagrantfile** permettant d' | ||
+ | |||
+ | <code ruby> | ||
+ | -*- mode: ruby -*- | ||
+ | # vi: set ft=ruby : | ||
+ | |||
+ | # All Vagrant configuration is done below. The " | ||
+ | # configures the configuration version (we support older styles for | ||
+ | # backwards compatibility). Please don't change it unless you know what | ||
+ | # you're doing. | ||
+ | Vagrant.configure(" | ||
+ | # The most common configuration options are documented and commented below. | ||
+ | # For a complete reference, please see the online documentation at | ||
+ | # https:// | ||
+ | |||
+ | # Every Vagrant development environment requires a box. You can search for | ||
+ | # boxes at https:// | ||
+ | config.vm.box = " | ||
+ | config.vm.hostname = " | ||
+ | |||
+ | # Disable automatic box update checking. If you disable this, then | ||
+ | # boxes will only be checked for updates when the user runs | ||
+ | # `vagrant box outdated`. This is not recommended. | ||
+ | # config.vm.box_check_update = false | ||
+ | |||
+ | # Create a forwarded port mapping which allows access to a specific port | ||
+ | # within the machine from a port on the host machine. In the example below, | ||
+ | # accessing " | ||
+ | # NOTE: This will enable public access to the opened port | ||
+ | # config.vm.network " | ||
+ | |||
+ | # Create a forwarded port mapping which allows access to a specific port | ||
+ | # within the machine from a port on the host machine and only allow access | ||
+ | # via 127.0.0.1 to disable public access | ||
+ | # config.vm.network " | ||
+ | |||
+ | # Create a private network, which allows host-only access to the machine | ||
+ | # using a specific IP. | ||
+ | # config.vm.network " | ||
+ | |||
+ | # Create a public network, which generally matched to bridged network. | ||
+ | # Bridged networks make the machine appear as another physical device on | ||
+ | # your network. | ||
+ | config.vm.network " | ||
+ | |||
+ | # Provider-specific configuration so you can fine-tune various | ||
+ | # backing providers for Vagrant. These expose provider-specific options. | ||
+ | # Example for VirtualBox: | ||
+ | # | ||
+ | | ||
+ | # # Display the VirtualBox GUI when booting the machine | ||
+ | # | ||
+ | # | ||
+ | # # Customize the amount of memory on the VM: | ||
+ | | ||
+ | end | ||
+ | # | ||
+ | # View the documentation for the provider you are using for more | ||
+ | # information on available options. | ||
+ | |||
+ | # Enable provisioning with a shell script. Additional provisioners such as | ||
+ | # Ansible, Chef, Docker, Puppet and Salt are also available. Please see the | ||
+ | # documentation for more information about their specific syntax and use. | ||
+ | | ||
+ | | ||
+ | apt install -y wget curl git vim | ||
+ | if ! which docker ; then | ||
+ | curl -s -o getdocker.sh https:// | ||
+ | bash getdocker.sh | ||
+ | | ||
+ | fi | ||
+ | # | ||
+ | SHELL | ||
+ | end | ||
+ | </ | ||
==== Création du projet Vagrant ==== | ==== Création du projet Vagrant ==== |