Skip to content

Cloud Blogs

Author – Madhusudhan Rao

Menu
  • AI for Healthcare
  • Archive Blogs
    • Cloud-Blogs by Madhusudhan Rao
      • ADF
        • ADF based Android Apps
        • ADF CRUD Cascaded LOVs
        • ADF CRUD Operation
        • ADF for Dummies
        • ADF for Financial Services Software Development
      • Analytics & Visualization
        • Business Intelligence
        • Oracle BI & DV Cloud Service
        • Setting up Oracle Analytics Cloud Instance and Data Visualization Techniques
      • App Servers & DevOps
        • How to deploy NodeJS Application on Oracle Application Container Cloud Service
        • Oracle Application Container Cloud Service
        • Oracle Java Cloud Service
      • OCI Admin Blogs
        • Create Oracle Cloud Infrastructure Instance
        • ElasticSearch & Kibana – Must for All Search Engine Development
        • How to Create Oracle Bare metal Compute Instance
        • Measuring Latency and TraceRoute Details with Oracle Edge Services
        • OCI Oracle cloud infrastructure – Setting up a NAT Instances for Public Internet Access from a Private Subnet
        • Oracle Cloud Infrastructure – OCI Creating buckets and object storage – setting up self expiry URLs
        • Oracle Cloud Infrastructure OCI – Create Instance ,Attach Block Volume , Open Ports, Setup Firewall rules
        • Python Basics
        • setting up Apache Tomcat on Oracle Cloud Infrastructure OCI
        • setting up CloudFlare DNS & HAProxy on Oracle Cloud Infrastructure for High Availability
        • Setting up Django Python Web Environment on Oracle Cloud
        • setting up File Storage on OCI and uploading files through Filezilla FTP
        • Setting up GPU-enabled Narupa server on Oracle Bare Metal Cloud for Virtual Reality Clients
        • setting up LAMP Stack , PHP 5.6, PhpMyAdmin , FTP and Mail Server on OCI
        • setting up Load Balancer on Oracle Cloud Infrastructure
        • setting up MongoDB Enterprise version Instance on Oracle Cloud Infrastructure Baremetal
        • setting up MongoDB on Oracle Cloud Infrastructure Classic and Opening Ports
        • Setting up SSH , FTP and Opening Ports on Oracle Cloud PaaS and IaaS
        • setting up web infrastructure DNS and HTTPS for your cloud Infrastructure as a Service OCI
        • World of Slack Programming
      • OCI Classic Blogs
        • How to Create WordPress blog on Oracle Cloud
        • running Function as a Service on Oracle Cloud Infrastructure – fnproject.io
        • running Hadoop & Big Data on Oracle Cloud Infrastructure
        • running TensorFlow Machine Learning for Image Recognition on Oracle Cloud Infrastructure
        • Setting up Kubernetes on Oracle Cloud Infrastructure – Classic
      • Oracle BPM for Financial Services
        • BPM for FS
        • 1. Setting up the development environment
        • 2. Modeling a home loan business process
        • 3. Implementing a home loan business process
        • 4. Deploying and testing a process workflow
        • 5. Administering processes
        • 6. Changing a business process by the process analyst
        • 7. Creating business reports for process owners
        • 8. Participating in a business process
        • 9. Integrating with business partners
        • 10. Collaborating with customers and end users
      • Oracle JET Series
    • Dockers on OCI Series
      • Comprehensive Blog on Dockers running on OCI
      • running a Docker Container on OCI
      • opening OCI Ports for Docker Containers
      • Building a Docker Image by using Dockerfile
      • Committing changes made in a Docker without using Dockerfile
      • pushing image to Docker Hub
      • DevOps with Github, Docker Hub and Oracle Container Cloud Services
      • running Apache Kafka for continuous data streaming on Oracle cloud infrastructure
    • Oracle Database Cloud Service
    • Oracle OKE Series
      • 01 Comprehensive Blog on Oracle Kubernetes Engine – getting started
      • 02 Configure Network Resources for Oracle Kubernetes Engine
      • 03 Creating 3 Worker and 2 Load Balancers Subnets for OKE
      • 04 Creating Oracle Kubernetes Cluster
      • 05 – Enable Cluster access through Command line interface
      • 06 – Getting onto Oracle Kubernetes Engine Dashboard
      • 07 Pod Configuration using a YAML Deployment
    • setting up and running Oracle Big Data PaaS
    • Setting up MySQL PaaS on Oracle Cloud
    • SOA BPM IDM Portal Series
      • FMW
        • Comprehensive Business Process Management – BPM 11g
        • FMW Install Startup Scripts
        • Oracle 11gR2 and 12c Database on Linux / OEL / Fedora
        • Oracle Identity Mangement
        • PS6, PS7, PS8 Install and Configuration
      • Webcenter Portal
        • Art of Webcenter Templating
        • Webcenter Sites Installation Linux
        • Webcenter Sites Look n feel
        • Webcenter Spaces
          • Custom Landing Page
        • Webcenter UCM Integration PS5
        • Webcenter, BPM Process Spaces – UCM PS5
        • BPM UCM and Webcenter PS5
      • BPM Series
        • 01-Simple BPM Task Initiator
        • 02-Business Rules and Exclusive Gateway
        • 03-Service Invocation Adapters
        • 04-BPM as a Web Service
        • 05-Mediator and Conditional Service Routing
        • 06-BPM Composer – Runtime Edit
        • 07-BPM and JMS Adapters
        • Oracle BPM 12c features
      • Process Cloud Service
        • Part 1 – Working with Process Cloud Service
        • Part 2 – How to Build Process , Data Persistence in Database Cloud Service
        • Part 3 – Invoking PCS Process from Oracle JET Framework
      • SOA Series
        • Oracle OSB 11g
        • Oracle SOA 11g Business Rules
        • Oracle SOA 11g DB Adapter
        • Oracle SOA 11g Mediator
        • SOA 11g AQ Adapters
    • Terraform on OCI Series
      • Create a Highly Scalable Cluster in the cloud using Terraform on OCI
      • Creating an Instance with New VNC Network
      • Managing the OCI Cluster with Slurm Workload Manager & Grafana
      • Terraform on OCI create instance
      • Terraform on OCI create load balancer
      • Terraform on OCI create non-federated user
      • Terraform on OCI create user, group, dynamic group and policies
      • Terraform on Oracle Cloud OCI
  • Database Series
    • Autonomous Data Warehouse and Analytics
      • 01 Preparing Client Machine
      • 02 Creating Autonomous Data Warehouse Instance
      • 03 Creating Tables into Autonomous Data Warehouse through SQL Developer
      • 04 Load Data into OCI Object storage and import that data into Autonomous Data warehouse
      • 05 Create Autonomous Analytics Cloud ADW Connection and create Data Visualization
    • Oracle Apex Cloud Service
Menu

Building a Docker Image by using Dockerfile

  1. Comprehensive Blog on Dockers running on OCI
  2. running a Docker Container on OCI
  3. opening OCI Ports for Docker Containers
  4. Building a Docker Image by using Dockerfile
  5. Committing changes made in a Docker without using Dockerfile
  6. Pushing Docker Images to Docker Hub
  7. DevOps with Github, Docker Hub and Oracle Container Cloud Services
Goal

Goal of this session is to create a Dockerfile whose task is to

  • create a debian OS ,
  • update the OS,
  • Install Git,
  • Install Vim
  • create a text file that lists all the directories
Dockerfile Source Code
FROM debian:latest
RUN apt-get update
RUN apt-get install -y git
RUN apt-get install -y vim
RUN ls > listfile.txt
Create Dockerfile copy paste the above source code
ubuntu@dockervm:~$ ls
ubuntu@dockervm:~$ clear
ubuntu@dockervm:~$ touch Dockerfile
ubuntu@dockervm:~$ vi Dockerfile
ubuntu@dockervm:~$ cat Dockerfile 
FROM debian:latest
RUN apt-get update
RUN apt-get install -y git
RUN ls > listfile.txt
Build the Docker Image with Dockerfile 
Repository Name is jamessmith73/debian
ubuntu@dockervm:~$ docker build -t jamessmith73/debian .
error checking context: 'no permission to read from '/home/ubuntu/.viminfo''.
ubuntu@dockervm:~$ sudo docker build -t jamessmith73/debian .
Sending build context to Docker daemon  17.92kB
Step 1/5 : FROM debian:latest
latest: Pulling from library/debian
bc9ab73e5b14: Already exists 
Digest: sha256:802706fa62e75c96fff96ada0e8ca11f570895ae2e9ba4a9d409981750ca544c
Status: Downloaded newer image for debian:latest
 ---> be2868bebaba
Step 2/5 : RUN apt-get update
 ---> Running in 7b07e8f2ad39
Get:1 http://security-cdn.debian.org/debian-security stretch/updates InRelease [94.3 kB]
Get:3 http://security-cdn.debian.org/debian-security stretch/updates/main amd64 Packages [454 kB]
...
Reading package lists...
Removing intermediate container 7b07e8f2ad39
 ---> ba0af66efb85
Step 3/5 : RUN apt-get install -y git
 ---> Running in 26c763ac9b4a
Reading package lists...
Building dependency tree...
Reading state information...
The following additional packages will be installed:
 ..
Suggested packages:
 ..
0 upgraded, 56 newly installed, 0 to remove and 1 not upgraded.
Need to get 22.7 MB of archives.
After this operation, 102 MB of additional disk space will be used.
Get:1 http://security-cdn.debian.org/debian-security stretch/updates/main amd64 libcurl3-gnutls amd64 7.52.1-5+deb9u8 [290 kB]
Get:2 http://security-cdn.debian.org/debian-security stretch/updates/main amd64 git-man all 1:2.11.0-3+deb9u4 [1433 kB]
..
Preparing to unpack .../12-libk5crypto3_1.15-1+deb9u1_amd64.deb ...
....
done.
Removing intermediate container 26c763ac9b4a
 ---> e3257851e022
Step 4/5 : RUN apt-get install -y vim
 ---> Running in f5e1c8fe47b4
..
Fetched 6731 kB in 0s (49.8 MB/s)
.....
Removing intermediate container f5e1c8fe47b4
 ---> 298c3a2ff986
Step 5/5 : RUN ls > listfile.txt
 ---> Running in 74974b05e6dc
Removing intermediate container 74974b05e6dc
 ---> 170489bdc17e
Successfully built 170489bdc17e
Successfully tagged jamessmith73/debian:latest
ubuntu@dockervm:~$ 

Just make a note about the Bold commands , at each Step a Container is created and removed

List and Run the Docker Container that we created now
ubuntu@dockervm:~$ docker images
REPOSITORY            TAG                 IMAGE ID            CREATED             SIZE
jamessmith73/debian   latest              170489bdc17e        6 minutes ago       249MB
tomcat                latest              ca9e2fccef98        7 days ago          463MB
debian                latest              be2868bebaba        3 weeks ago         101MB
ubuntu@dockervm:~$ docker run jamessmith73/debian:latest cat listfile.txt
bin
boot
dev
etc
home
lib
lib64
listfile.txt
media
mnt
opt
proc
root
run
sbin
srv
sys
tmp
usr
var
Committing the changes to version 1.0
ubuntu@dockervm:~$ docker ps -a
CONTAINER ID        IMAGE                        COMMAND              CREATED             STATUS                      PORTS               NAMES
4ecfe884aecf        jamessmith73/debian:latest   "cat listfile.txt"   24 minutes ago      Exited (0) 24 minutes ago                       confident_yonath
c00aeaaee7ca        jamessmith73/debian:latest   "ls"                 24 minutes ago      Exited (0) 24 minutes ago                       sad_davinci
192bd7f7870f        jamessmith73/debian:latest   "bash"               25 minutes ago      Exited (0) 25 minutes ago                       blissful_goldstine
ubuntu@dockervm:~$ docker commit 4ecfe884aecf jamessmith73/debian:1.0
sha256:90c1c24a6dd6e99fb02a786cba7a7b45d83d18ad8134bda9e59e568b74a07d51
ubuntu@dockervm:~$ docker images
REPOSITORY            TAG                 IMAGE ID            CREATED             SIZE
jamessmith73/debian   1.0                 90c1c24a6dd6        24 seconds ago      249MB
jamessmith73/debian   latest              170489bdc17e        34 minutes ago      249MB
tomcat                latest              ca9e2fccef98        7 days ago          463MB
debian                latest              be2868bebaba        3 weeks ago         101MB
busybox               latest              59788edf1f3e        4 weeks ago         1.15MB
hello-world           latest              4ab4c602aa5e        8 weeks ago         1.84kB

What Next >> Creating Same Docker Container without using Dockerfile

Log in
  • AI for Healthcare
  • Archive Blogs
    • Cloud-Blogs by Madhusudhan Rao
      • ADF
        • ADF based Android Apps
        • ADF CRUD Cascaded LOVs
        • ADF CRUD Operation
        • ADF for Dummies
        • ADF for Financial Services Software Development
      • Analytics & Visualization
        • Business Intelligence
        • Oracle BI & DV Cloud Service
        • Setting up Oracle Analytics Cloud Instance and Data Visualization Techniques
      • App Servers & DevOps
        • How to deploy NodeJS Application on Oracle Application Container Cloud Service
        • Oracle Application Container Cloud Service
        • Oracle Java Cloud Service
      • OCI Admin Blogs
        • Create Oracle Cloud Infrastructure Instance
        • ElasticSearch & Kibana - Must for All Search Engine Development
        • How to Create Oracle Bare metal Compute Instance
        • Measuring Latency and TraceRoute Details with Oracle Edge Services
        • OCI Oracle cloud infrastructure - Setting up a NAT Instances for Public Internet Access from a Private Subnet
        • Oracle Cloud Infrastructure - OCI Creating buckets and object storage - setting up self expiry URLs
        • Oracle Cloud Infrastructure OCI - Create Instance ,Attach Block Volume , Open Ports, Setup Firewall rules
        • Python Basics
        • setting up Apache Tomcat on Oracle Cloud Infrastructure OCI
        • setting up CloudFlare DNS & HAProxy on Oracle Cloud Infrastructure for High Availability
        • Setting up Django Python Web Environment on Oracle Cloud
        • setting up File Storage on OCI and uploading files through Filezilla FTP
        • Setting up GPU-enabled Narupa server on Oracle Bare Metal Cloud for Virtual Reality Clients
        • setting up LAMP Stack , PHP 5.6, PhpMyAdmin , FTP and Mail Server on OCI
        • setting up Load Balancer on Oracle Cloud Infrastructure
        • setting up MongoDB Enterprise version Instance on Oracle Cloud Infrastructure Baremetal
        • setting up MongoDB on Oracle Cloud Infrastructure Classic and Opening Ports
        • Setting up SSH , FTP and Opening Ports on Oracle Cloud PaaS and IaaS
        • setting up web infrastructure DNS and HTTPS for your cloud Infrastructure as a Service OCI
        • World of Slack Programming
      • OCI Classic Blogs
        • How to Create WordPress blog on Oracle Cloud
        • running Function as a Service on Oracle Cloud Infrastructure - fnproject.io
        • running Hadoop & Big Data on Oracle Cloud Infrastructure
        • running TensorFlow Machine Learning for Image Recognition on Oracle Cloud Infrastructure
        • Setting up Kubernetes on Oracle Cloud Infrastructure - Classic
      • Oracle BPM for Financial Services
        • BPM for FS
        • 1. Setting up the development environment
        • 2. Modeling a home loan business process
        • 3. Implementing a home loan business process
        • 4. Deploying and testing a process workflow
        • 5. Administering processes
        • 6. Changing a business process by the process analyst
        • 7. Creating business reports for process owners
        • 8. Participating in a business process
        • 9. Integrating with business partners
        • 10. Collaborating with customers and end users
      • Oracle JET Series
    • Dockers on OCI Series
      • Comprehensive Blog on Dockers running on OCI
      • running a Docker Container on OCI
      • opening OCI Ports for Docker Containers
      • Building a Docker Image by using Dockerfile
      • Committing changes made in a Docker without using Dockerfile
      • pushing image to Docker Hub
      • DevOps with Github, Docker Hub and Oracle Container Cloud Services
      • running Apache Kafka for continuous data streaming on Oracle cloud infrastructure
    • Oracle Database Cloud Service
    • Oracle OKE Series
      • 01 Comprehensive Blog on Oracle Kubernetes Engine - getting started
      • 02 Configure Network Resources for Oracle Kubernetes Engine
      • 03 Creating 3 Worker and 2 Load Balancers Subnets for OKE
      • 04 Creating Oracle Kubernetes Cluster
      • 05 - Enable Cluster access through Command line interface
      • 06 - Getting onto Oracle Kubernetes Engine Dashboard
      • 07 Pod Configuration using a YAML Deployment
    • setting up and running Oracle Big Data PaaS
    • Setting up MySQL PaaS on Oracle Cloud
    • SOA BPM IDM Portal Series
      • FMW
        • Comprehensive Business Process Management - BPM 11g
        • FMW Install Startup Scripts
        • Oracle 11gR2 and 12c Database on Linux / OEL / Fedora
        • Oracle Identity Mangement
        • PS6, PS7, PS8 Install and Configuration
      • Webcenter Portal
        • Art of Webcenter Templating
        • Webcenter Sites Installation Linux
        • Webcenter Sites Look n feel
        • Webcenter Spaces
          • Custom Landing Page
        • Webcenter UCM Integration PS5
        • Webcenter, BPM Process Spaces - UCM PS5
        • BPM UCM and Webcenter PS5
      • BPM Series
        • 01-Simple BPM Task Initiator
        • 02-Business Rules and Exclusive Gateway
        • 03-Service Invocation Adapters
        • 04-BPM as a Web Service
        • 05-Mediator and Conditional Service Routing
        • 06-BPM Composer - Runtime Edit
        • 07-BPM and JMS Adapters
        • Oracle BPM 12c features
      • Process Cloud Service
        • Part 1 - Working with Process Cloud Service
        • Part 2 – How to Build Process , Data Persistence in Database Cloud Service
        • Part 3 – Invoking PCS Process from Oracle JET Framework
      • SOA Series
        • Oracle OSB 11g
        • Oracle SOA 11g Business Rules
        • Oracle SOA 11g DB Adapter
        • Oracle SOA 11g Mediator
        • SOA 11g AQ Adapters
    • Terraform on OCI Series
      • Create a Highly Scalable Cluster in the cloud using Terraform on OCI
      • Creating an Instance with New VNC Network
      • Managing the OCI Cluster with Slurm Workload Manager & Grafana
      • Terraform on OCI create instance
      • Terraform on OCI create load balancer
      • Terraform on OCI create non-federated user
      • Terraform on OCI create user, group, dynamic group and policies
      • Terraform on Oracle Cloud OCI
  • Database Series
    • Autonomous Data Warehouse and Analytics
      • 01 Preparing Client Machine
      • 02 Creating Autonomous Data Warehouse Instance
      • 03 Creating Tables into Autonomous Data Warehouse through SQL Developer
      • 04 Load Data into OCI Object storage and import that data into Autonomous Data warehouse
      • 05 Create Autonomous Analytics Cloud ADW Connection and create Data Visualization
    • Oracle Apex Cloud Service

"Technology has the shelf life of a banana. By the time you buy it, implement it and train people on it, it’s obsolete. … ” as said by Mr Scott McNealy

© 2023 Cloud Blogs | Powered by Minimalist Blog WordPress Theme