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. Use our Linode referral link if you plan to buy VPS (it starts at only $10/month).
  4. Support us via PayPal donate - Make a Donation
  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...

8 Responses

  1. kosmos says:

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

    i got this error message

    [root@ip-172-31-19-219 ~]# 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.

        [root@docker ~]# 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
        [root@docker ~]# docker run ubuntu-nginx whereis nginx
        nginx: /usr/sbin/nginx /etc/nginx /usr/share/nginx /usr/share/man/man1/nginx.1.gz
        [root@docker ~]#
  2. 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

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

Join Over 300K+ Linux Users
  1. 177,942
  2. 8,310
  3. 37,548

Are you subscribed?