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

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

13 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:

      @Ramakrishna,

      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.

    [roo[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

    Thanks!

    • 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 ‘docker.io/nickistre/ubuntu-lamp‘, 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
        docker.io/nickistre/ubuntu-lamp   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] ~]#
        
  4. Shambhu says:

    hi,
    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:

        Hi,
        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
    Ravi

Leave a Reply to Matei Cezar Cancel reply

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.