このコンテンツは選択した言語では利用できません。
Chapter 4. Installing Container Development Kit on Mac OS X
To prepare your Mac OS X development system for running Container Development Kit, the steps are:
- Download and install VirtualBox.
- Download and install Vagrant.
- Download Red Hat Container Tools and the Container Development Kit Vagrant box for VirtualBox.
- Install additional Vagrant plugins to support Red Hat Subscription Management and other features.
4.1. Prerequisites for Installing Container Development Kit on Mac OS X リンクのコピーリンクがクリップボードにコピーされました!
To run the Container Development Kit on a Mac OS X system, you need:
- An Intel-based Mac with a minimum of 4 GB of RAM running a recent, 64-bit version of Mac OS X, such as 10.11 (El Capitan) or later.
- A minimum of 3 GB of free disk space for virtual machine images. Note that during the setup process, you will need to be able to store multiple copies of each of the virtual machine images.
- Adequate Internet connectivity to download 1—2 GB of software.
- An available Red Hat Enterprise Linux Server subscription with support or Red Hat Enterprise Linux Developer Suite. Note that Red Hat Enterprise Linux subscriptions with self-support do not have access to all of the necessary software for CDK in all environments.
4.2. Installing Software and Configuring the Host System リンクのコピーリンクがクリップボードにコピーされました!
Vagrant is used to run a Red Hat Enterprise Linux virtual machine with all necessary components for the Container Development Environment. Virtualization is provided by installing VirtualBox.
Please note that Vagrant is strictly command-line oriented. All interaction with Vagrant is through the command line from a terminal prompt. Use Terminal.app from the Applications
Command-line instructions use path names with a tilde, such as ~/cdk. This is a shorthand notation for a path relative to the current user’s home directory, /Users/username/cdk.
4.2.1. Additional Software Requirements for Mac OS X リンクのコピーリンクがクリップボードにコピーされました!
In order to run Container Development Kit, some command-line development tools are needed on your Mac. Install either Apple Command Line Development Tools or Apple Xcode.
Download and install VirtualBox for Mac OS X from http://www.virtualbox.org.
NoteChoose a location for storing VirtualBox VM images. By default, these are stored in subdirectory in your home directory (
~/VirtualBox VMs). You need several gigabytes of space wherever you choose to store these images. To change the location, start VirtualBox, go to VirtualBoxPreferences General and change Default Machine Folder to the desired location. Documentation for VirtualBox can be found on the virtualbox.org website. Download and install Vagrant from https://releases.hashicorp.com/vagrant/. Select the folder with the 1.8.1 release and download the Vagrant installation file in the
.dmgformat (vagrant_1.8.1.dmg). The 1.7.4 version of Vagrant is also supported for use with Red Hat Container Development Kit 2.1.The default is to install Vagrant in the
/opt/vagrantdirectory. You can change this. The Vagrant installer creates a/usr/bin/vagrantsymbolic link that points to/opt/vagrant/bin/vagrant, so no adjustments to thePATHenvironment variable are necessary.
4.3. Setting Up Container Development Kit Software Components リンクのコピーリンクがクリップボードにコピーされました!
Download the Container Development Kit software components from the Red Hat Product Downloads web site. You must log in to get access to this page. If you are on the right page, you should see "Product Variant: Red Hat Container Development Kit". You need to download the following items:
- Red Hat Container Tools
RHEL 7.2 Vagrant box for VirtualBox
NoteThe page also offers Vagrant box downloads formatted for other virtualization platforms, such as libvirt. You only need to download the box image that matches the virtualization you are using — VirtualBox.
The following steps assume you have saved these files in your home directory in
~/Downloads. If you used a different directory, adjust the paths accordingly. You need several gigabytes of free space for the Vagrant box images.All of the remaining steps need to be performed using the command-line using the Terminal Application (Terminal.app). You can find Terminal.app in the Application
Utilities Folder. NoteThe following steps assume you have saved the downloaded files in your home directory in
~/Downloads. If you used a different directory, adjust the paths accordingly.
Unzip the ZIP file you downloaded in your (the name of the zip file may change to reflect a release number). This should create the
~/cdksubdirectory (/Users/<username>/cdk):$ cd $ unzip ~/Downloads/cdk-2.1.0.zipInstall the
vagrant-registration,vagrant-service-manager, andvagrant-sshfsplugins (the plugins in the form of.gemfiles are included in the ZIP file).The installation of the first plugin may take several minutes, and Vagrant may install some additional gem files as needed.
$ cd ~/cdk/plugins $ ls -1 *.gem $ vagrant plugin install \ ./vagrant-registration-*.gem \ ./vagrant-service-manager-*.gem \ ./vagrant-sshfs-*.gemVerify the plugins are installed by running the following command:
$ vagrant plugin listAdd the Container Development Kit box to Vagrant. This is the configured virtual machine image that you downloaded in one of the previous steps.
$ vagrant box add --name cdkv2 ~/Downloads/rhel-cdk-kubernetes-7.2.x86_64.vagrant-virtualbox.box*ImportantThe name you assign to the box using the
--nameparameter in the above step must correspond to the name used by the Vagrantfile used to initialize the box. By default, this iscdkv2for the Vagrantfiles provided with Container Development Kit.Verify that the box is installed:
$ vagrant box list cdkv2 (virtualbox, 0)The box image file will be stored in your home directory under
~/.vagrant.d. You need adequate space there, approximately 2 GB.
4.4. Starting the Container Development Kit Vagrant Box on Mac OS X リンクのコピーリンクがクリップボードにコピーされました!
Container Development Kit offers two Vagrantfiles for initializing the Container Development Environment with different services:
-
OpenShift (
rhel-ose): Use the OpenShift Vagrantfile to launch a Red Hat Enterprise Linux Server virtual machine (VM) with OpenShift Enterprise running in it. With OpenShift running, you can use either the web user interface from a web browser on your desktop, ordocker,oc, and related commands by logging into the VM. -
Kubernetes (
rhel-k8s-singlenode-setup): Use the Kubernetes Vagrantfile to start a more generic Container Development Kit VM. Because OpenShift is not running, you can configure a more basic Kubernetes configuration or use Docker directly.
You can modify the existing Vagrantfiles for your own purposes. For example, you might want to use a different IP address if it conflicts with an address on your local network.
Due to a known issue that causes Red Hat JBoss Developer Studio to freeze upon start up when it attempts to launch Container Development Kit with the configuration that sets up automatic directory sharing through SSHFS, the use of the vagrant-sshfs plugin is disabled by default in Container Development Kit 2.1.
This problem does not concern any other uses than when Container Development Kit is launched from the graphical environment of Red Hat JBoss Developer Studio.
To use SSHFS when you launch Container Development Kit from the command line, you need to use the Vagrant files that are provided in the Red Hat Container Tools ZIP in the following subdirectory: cdk/components/rhel/misc/shared_folder/.
Initialize the Container Development Kit Vagrant box:
Start Container Development Kit with OpenShift Enterprise as follows:
$ cd ~/cdk/components/rhel/misc/shared_folder/rhel-ose/ $ vagrant upStart Container Development Kit with single-node Kubernetes follows:
$ cd ~/cdk/components/rhel/misc/shared_folder/rhel-k8s-singlenode-setup/ $ vagrant up
Enter the username and password you use with the Red Hat Customer Portal to register the Red Hat Enterprise Linux system running in the Vagrant box:
==> default: Registering box with vagrant-registration… default: Would you like to register the system now (default: yes)? [y|n] y default: Subscriber username: <username> default: Subscriber password:Check whether your Vagrant box is running using the
vagrant statuscommand. Note that you must be in the same directory where your Vagrantfile is located. For example:$ cd ~/cdk/components/rhel/rhel-ose/ $ vagrant status
If the machine state shows as running, you are ready to start using your Container Development Environment.
4.5. Additional Resources リンクのコピーリンクがクリップボードにコピーされました!
The Container Development Kit Getting Started Guide provides information on:
- using installed Vagrant plugins
- interacting with Vagrant boxes
- starting with container development
- using Docker, Kubernetes, and OpenShift Enterprise
- Vagrant Documentation
- VirtualBox Documentation