Dieser Inhalt ist in der von Ihnen ausgewählten Sprache nicht verfügbar.
Chapter 3. Interacting with the CDK Vagrant Box
Following the creation and configuration of the CDK Vagrant box using the vagrant up command, you can interact with the running virtual machine using the vagrant command. Using the vagrant-service-manager plugin, you can set up your host workstation to interact with the Docker service running inside the Vagrant box.
3.1. Using the vagrant-service-manager Plugin Link kopierenLink in die Zwischenablage kopiert!
On the host machine, you can use the vagrant-service-manager plugin to obtain information about the Docker, OpenShift, and Kubernetes services running in the virtual machine. It displays environment variables that need to be set on the host system (your development workstation) to enable host-based tools (such as the Eclipse IDE, the docker command, or OpenShift’s oc command) to interact with the Docker daemon from the virtual machine.
The vagrant-service-manager plugin automatically recognizes the host operationg system and outputs information based on the platform.
3.1.1. Setting the Host Environment on Linux and Mac OS X Link kopierenLink in die Zwischenablage kopiert!
Run the following command from the directory in which the Vagrant box was initialized (in this example, the rhel-ose Vagrantfile was used to provision the CDK Vagrant box):
Run the following command to set the required environment variables, so that the docker client on the host system can be used to interact with the Docker service running inside the CDK virtual machine:
eval "$(vagrant service-manager env docker)"
~]$ eval "$(vagrant service-manager env docker)"
3.1.2. Setting Up the Host Environment on Windows Link kopierenLink in die Zwischenablage kopiert!
Run the following command from the directory in which the Vagrant box was initialized (in this example, the rhel-ose Vagrantfile was used to provision the CDK Vagrant box).
To set the required environment variables, so that the docker.exe client on the host system can be used to interact with the Docker service running inside the CDK virtual machine, you need to run the following commands (note that you need to use the Cygwin Bash environment for the commands to work properly):
export VAGRANT_DETECTED_OS=cygwin eval "$(VAGRANT_NO_COLOR=1 vagrant service-manager env docker | tr -d '\r')"
~]$ export VAGRANT_DETECTED_OS=cygwin
~]$ eval "$(VAGRANT_NO_COLOR=1 vagrant service-manager env docker | tr -d '\r')"