このコンテンツは選択した言語では利用できません。

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:

  1. Download and install VirtualBox.
  2. Download and install Vagrant.
  3. Download Red Hat Container Tools and the Container Development Kit Vagrant box for VirtualBox.
  4. 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 Utilities folder or a terminal emulator of your choice for running Vagrant.

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.

  1. Download and install VirtualBox for Mac OS X from http://www.virtualbox.org.

    Note

    Choose 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 VirtualBox Preferences General and change Default Machine Folder to the desired location. Documentation for VirtualBox can be found on the virtualbox.org website.

  2. 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 .dmg format (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/vagrant directory. You can change this. The Vagrant installer creates a /usr/bin/vagrant symbolic link that points to /opt/vagrant/bin/vagrant, so no adjustments to the PATH environment variable are necessary.

4.3. Setting Up Container Development Kit Software Components

  1. 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

      Note

      The 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.

      Note

      The 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.

  2. 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 ~/cdk subdirectory (/Users/<username>/cdk):

    $ cd
    $ unzip ~/Downloads/cdk-2.1.0.zip
  3. Install the vagrant-registration, vagrant-service-manager, and vagrant-sshfs plugins (the plugins in the form of .gem files 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-*.gem
  4. Verify the plugins are installed by running the following command:

    $ vagrant plugin list
  5. Add 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*
    Important

    The name you assign to the box using the --name parameter in the above step must correspond to the name used by the Vagrantfile used to initialize the box. By default, this is cdkv2 for the Vagrantfiles provided with Container Development Kit.

  6. 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, or docker, 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.
Note

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.

Important

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/.

  1. 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 up
    • Start Container Development Kit with single-node Kubernetes follows:

      $ cd ~/cdk/components/rhel/misc/shared_folder/rhel-k8s-singlenode-setup/
      $ vagrant up
  2. 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:
  3. Check whether your Vagrant box is running using the vagrant status command. 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

Red Hat logoGithubredditYoutubeTwitter

詳細情報

試用、購入および販売

コミュニティー

Red Hat ドキュメントについて

Red Hat をお使いのお客様が、信頼できるコンテンツが含まれている製品やサービスを活用することで、イノベーションを行い、目標を達成できるようにします。 最新の更新を見る.

多様性を受け入れるオープンソースの強化

Red Hat では、コード、ドキュメント、Web プロパティーにおける配慮に欠ける用語の置き換えに取り組んでいます。このような変更は、段階的に実施される予定です。詳細情報: Red Hat ブログ.

会社概要

Red Hat は、企業がコアとなるデータセンターからネットワークエッジに至るまで、各種プラットフォームや環境全体で作業を簡素化できるように、強化されたソリューションを提供しています。

Theme

© 2026 Red Hat
トップに戻る