Step 2 - Copying the bin file

For upgrading the image, we will be using a bin file of the older image already developed. Let us download a .bin file to the directory we have created. Before that, let us install wget package. For doing so, execute the following command

yum install wget -y
Now, navigate to the Source directory and download the bin file by executing the following command
cd ~/Sourcewget https://www.dropbox.com/s/jivdkyoi6sttbp4/bdcatalog-centos7-bluedata-cdh514_centos7x-1.7.tar

Extract the content of the tar file by executing the following command
tar xvf bdcatalog-centos7-bluedata-cdh514_centos7x-1.7.tar

Now, Make the .bin file executable by executing the following commandchmod +x bdcatalog-centos7-bluedata-cdh514_centos7x-1.7.bin

Step 3 - Extracting the contents of the bin file

In this step we will extract the contents of the .bin file.
For this, execute the following command../bdcatalog-centos7-bluedata-cdh514_centos7x-1.7.bin --payload
This will create two files in the directory. (to view the files execute the following command)ls

Untar the payload.tar file by executing the following command
tar xvf payload.tar

This will create new directories. (to view the files execute the following command)ls

Delete the bin file to save space on the devicerm -rf bdcatalog-centos7-bluedata-cdh514_centos7x-1.7.bin

Navigate to the new directory, and untar the file by executing the following command
cd bdcatalog-centos7-bluedata-cdh514_centos7x-1.7tar xvf bdcatalog-centos7-bluedata-cdh514_centos7x-1.7-src.tgz

Now navigate to the directory created after the above step
cd bdcatalog-centos7-bluedata-cdh514_centos7x-1.7-src

Copy the content of this directory to the directory you created initially
cp -R * ~/Source/CDH

Step 4 - Making changes in the old image for new image

Now, to upgrade an existing image to a new one, we should make changes in some of the files like:
-.wb file
-Dockerfile
-json file
In the next few steps we will be modifying these files to upgrade our application image.

Step 5 - Modifying the .wb file

Now, we will make changes in .wb file first.
In wb file, we need to change the versions of the images we are downloading.

We already have a reference .wb file. We just need to replace the current .wb file with the reference one. For doing so, execute the following commands.cd ~/Source/CDHrm -rf cdh514.wbcp ~/test/cdh515.wb ~/Source/CDH

To view the content of the file, execute the followingcat ~/Source/CDH/cdh515.wb

Step 6 - Modifying the Dockerfile

In this step we will make changes in our Dockerfile.

We already have a reference Dockerfile. We just need to replace the current Dockerfile with the reference one. For doing so, execute the following commands.
rm -rf ~/Source/CDH/image/centos/Dockerfilecp ~/test/Dockerfile ~/Source/CDH/image/centos/

To view the content of the file, execute the following
cat ~/Source/CDH/image/centos/Dockerfile

Step 7 - Modifying the json file

Now, we will make changes in our .json file.

We already have a reference json file. We just need to replace the current json file with the reference one. For doing so, execute the following commands.
rm -rf ~/Source/CDH/cdh514.jsoncp ~/test/cdh515.json ~/Source/CDH/

To view the content of the file, execute the following
cat ~/Source/CDH/cdh515.json

Step 8 - Creating the image

Now, for creting the bin file, let us execute the .wb file.
./cdh515.wb
After executing the command, wait for sometime as the bin file will take time to create!!!!

Step 9 - Checking the bin for the image

The newly built bin is saved in the deliverables directory.

cd deliverablesls

Also, you can verify the created image by executing the following command

Debugging Scenarios

Help

Katacoda offerings an Interactive Learning Environment for Developers. This course uses a command line and a pre-configured sandboxed environment for you to use. Below are useful commands when working with the environment.

cd <directory>

Change directory

ls

List directory

echo 'contents' > <file>

Write contents to a file

cat <file>

Output contents of file

Vim

In the case of certain exercises you will be required to edit files or text. The best approach is with Vim. Vim has two different modes, one for entering commands (Command Mode) and the other for entering text (Insert Mode). You need to switch between these two modes based on what you want to do. The basic commands are: