How to Install, Run and Delete Applications inside Docker Containers – Part 2

Best Affordable Linux and WordPress Services For Your Business
Outsource Your Linux and WordPress Project and Get it Promptly Completed Remotely and Delivered Online.

If You Appreciate What We Do Here On TecMint, You Should Consider:

  1. Stay Connected to: Twitter | Facebook | Google Plus
  2. Subscribe to our email updates: Sign Up Now
  3. Get your own self-hosted blog with a Free Domain at ($3.45/month).
  4. Become a Supporter - Make a contribution via PayPal
  5. Support us by purchasing our premium books in PDF format.
  6. Support us by taking our online Linux courses

We are thankful for your never ending support.

Matei Cezar

I'am a computer addicted guy, a fan of open source and linux based system software, have about 4 years experience with Linux distributions desktop, servers and bash scripting.

Your name can also be listed here. Got a tip? Submit it here to become an TecMint author.

RedHat RHCE and RHCSA Certification Book
Linux Foundation LFCS and LFCE Certification Preparation Guide

You may also like...

14 Responses

  1. Ramakrishna Nissankula says:

    I am struggling with the following. Can you please help me?

    I installed docker in a Ubuntu VM on my virtual box.

    My goal is that: From a centos based container that is running in this docker, I want to launch other docker containers. How do I do this?

    Do I need to yum install docker inside my first docker image?

    docker is present only in host Ubuntu VM. How can the centos based container run docker commands?

    • Ravi Saive says:


      Your question is still not clear to me..

      If you want to run CentOS container under Ubuntu VM, you can create container as explained in this article..

  2. Muthukumar says:

    I am getting below error. How do I edit /etc/apt/source.list Vi command is not working in Ubuntu image. Please help me on this.

    [[email protected] ~]# docker run ubuntu bash -c “apt-get -y install nginx”
    Reading package lists…
    Building dependency tree…
    Reading state information…
    E: Unable to locate package nginx

  3. kosmos says:

    Hi, when I run the command # docker run ubuntu bash -c “apt-get -y install nginx”

    i got this error message

    [[email protected] ~]# docker run ubuntu bash -c “apt-get -y install nginx”
    Reading package lists…
    Building dependency tree…
    Reading state information…
    E: Unable to locate package nginx


    • Matei Cezar says:

      What image are you using? verify /etc/apt/sources.list and always run sudo apt-get update before installing anything so that the package list is up-to-date.

      • Debojyoti Bose says:

        The above error indicates that the repos (universe) inside the sources.list doesn’t have the required package (nginx) for the image ‘ubuntu’. Things will work If you try using the image ‘‘, you will be able install the nginx daemon inside the container.

        [[email protected] ~]# docker images
        REPOSITORY                        TAG                 IMAGE ID            CREATED             SIZE
        ubuntu-nginx                      latest              7f6682022f10        23 minutes ago      642.6 MB   latest              28db94cff13b        7 days ago          634.5 MB
        [[email protected] ~]# docker run ubuntu-nginx whereis nginx
        nginx: /usr/sbin/nginx /etc/nginx /usr/share/nginx /usr/share/man/man1/nginx.1.gz
        [[email protected] ~]#
    • ISAHAK says:

      It is because there is no package cache in the image, you need to run:

      # apt-get update
  4. Shambhu says:

    Could you please let me know how can I set IP in docker image ?

    • Matei Cezar says:

      You cannot set an IP address inside a docker container, but you can create a bridge interface on the host and instruct a docker container to use that bridge using the -b option.

      • Shambhu says:

        Thanks But after apache install how I will call at browser ? Could you please share any doc or tutorial for this ?

        I will be thank full

  5. Ravi says:

    Please post next part of Docker..

    Many Thanks

Got something to say? Join the discussion.

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.