jessewei

Laboratory to bluemix, a cloud solution exercise to etl scheduler

Archive for the tag “ubuntu”

Bluemix Container Lab @ Windows

Preparation

There are many configuration to enable Bulemix devops process. Here I show is the easiest way for lab.

  1. Install Docker@Windows
    Install Docker Toolbox
  2. Sign up for an IBM Bluemix account
  3. Install IBM Containers plugin
    Table 1. Two ways to install plugin @ Windows
    Operating system Command
    Windows 7 64-bit
    Linux 64-bit@VirtualBox

     

  4. Sign up for IBM Containers in IBM Bluemix
    • From the Bluemix dashboard, click Start Containers
    • You will be prompted to Set registry namespace.
    • Enter in a registry name, cannot be changed afterwards. This registry name is used across your account when using the IBM Containers service.

Read more…

2. Install Docker

 

Docker Installation reference

Update apt sources

To set APT to use packages from the new repository:

  1. Open a terminal window.
  2. Update package information, ensure that APT works with the https method, and that CA certificates are installed.
     $ sudo apt-get update
     $ sudo apt-get install apt-transport-https ca-certificates
    
  3. Add the new GPG key.
    $ sudo apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
    
  4. Open the /etc/apt/sources.list.d/docker.list file in your favourite editor.If the file doesn’t exist, create it. For example,$ sudo vi /etc/apt/sources.list.d/docker.list 
  5. Remove any existing entries.
  6. Add an entry for your Ubuntu operating system.The possible entries are:
    • On Ubuntu Trusty 14.04 (LTS)
      deb https://apt.dockerproject.org/repo ubuntu-trusty main
      

    Save and close the /etc/apt/sources.list.d/docker.list file.

  7. Update the APT package index.
    $ sudo apt-get update
    
  8. Purge the old repo if it exists.
    $ sudo apt-get purge lxc-docker
    
  9. Verify that APT is pulling from the right repository.
    $ sudo apt-cache policy docker-engine
    

    From now on when you run apt-get upgrade, APT pulls from the new repository.

Prerequisites by Ubuntu Version

For Ubuntu Trusty and Wily, it’s recommended to install the linux-image-extra kernel package. The linux-image-extra package allows you use the aufs storage driver.

To install the linux-image-extra package for your kernel version:

  1. Open a terminal on your Ubuntu host.
  2. Update your package manager.
    $ sudo apt-get update
    
  3. Install the recommended package.
    $ sudo apt-get install linux-image-extra-$(uname -r)
    
  4. Go ahead and install Docker.
  5. Install apparmor is required. You can install it using:
    $ sudo apt-get install apparmor

 

Install Docker

Then, install Docker using the following:

  1. Update your APT package index.
    $ sudo apt-get update
    
  2. Install Docker.
    $ sudo apt-get install docker-engine
    
  3. Start the docker daemon.
    $ sudo service docker start
    
  4. Verify docker is installed correctly.
    $ sudo docker run hello-world
    

    This command downloads a test image and runs it in a container. When the container runs, it prints an informational message. Then, it exits.

Create a Docker group

The docker daemon binds to a Unix socket instead of a TCP port. By default that Unix socket is owned by the user root and other users can access it with sudo. For this reason, docker daemon always runs as the root user.

To avoid having to use sudo when you use the docker command, create a Unix group called docker and add users to it. When the docker daemon starts, it makes the ownership of the Unix socket read/writable by the docker group.

To create the docker group and add your user:

  1. Create the docker group and add your user.
    $ sudo usermod -aG docker osboxes
    
  2. Log out and log back in.This ensures your user is running with the correct permissions.
  3. Verify your work by running docker without sudo.
    $ docker run hello-world
    

    If this fails with a message similar to this:

    Cannot connect to the Docker daemon. Is 'docker daemon' running on this host?
    

    Check that the DOCKER_HOST environment variable is not set for your shell. If it is, unset it.

Post Navigation