LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 05-26-2015, 09:47 AM   #1
sndlt
Member
 
Registered: Jun 2014
Posts: 55

Rep: Reputation: Disabled
Docker - ubuntu apache not starting


I'm trying to bring up a container using following Dockerfile.
But ends in error.

[Dockerfile]
FROM ubuntu:15.04

RUN apt-get update && apt-get install -y iputils-ping apache2

ENV var1=Nigel var2=Poulton

ENTRYPOINT ["apache2ctl"]

----------------------------------------------------------

[root@puppetmaster hw]# docker run -it nigel1 /bin/bash
/usr/sbin/apache2ctl: 87: ulimit: error setting limit (Operation not permitted)
Setting ulimit failed. See README.Debian for more information.
Usage: /usr/sbin/apache2 [-D name] [-d directory] [-f file]
[-C "directive"] [-c "directive"]
[-k start|restart|graceful|graceful-stop|stop]
[-v] [-V] [-h] [-l] [-L] [-t] [-T] [-S] [-X]
Options:
-D name : define a name for use in <IfDefine name> directives
-d directory : specify an alternate initial ServerRoot
-f file : specify an alternate ServerConfigFile
-C "directive" : process directive before reading config files
-c "directive" : process directive after reading config files
-e level : show startup errors of level (see LogLevel)
-E file : log startup errors to file
-v : show version number
-V : show compile settings
-h : list available command line options (this page)
-l : list compiled in modules
-L : list available configuration directives
-t -D DUMP_VHOSTS : show parsed vhost settings
-t -D DUMP_RUN_CFG : show parsed run settings
-S : a synonym for -t -D DUMP_VHOSTS -D DUMP_RUN_CFG
-t -D DUMP_MODULES : show all loaded modules
-M : a synonym for -t -D DUMP_MODULES
-t : run syntax check for config files
-T : start without DocumentRoot(s) check
-X : debug mode (only one worker, do not detach)
[root@puppetmaster hw]#
 
Old 05-26-2015, 10:19 AM   #2
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
Well, you made the Dockerfile, and then tried to run it.
Did you try and build it first? That's what Dockerfiles are for
Otherwise,
Code:
docker images nigel*
shows what?

What's the source of this Dockerfile, originally?

Last edited by Habitual; 05-26-2015 at 10:20 AM.
 
Old 05-26-2015, 11:19 AM   #3
sndlt
Member
 
Registered: Jun 2014
Posts: 55

Original Poster
Rep: Reputation: Disabled
Yep, I forgot to put the part where I built from the Dockerfile. I think I ran something like "docker build t="nigel1"

I'll run "docker images nigel*" when I get home.

The Dockerfile is from PluralSight's Docker course.

Are you familiar with the error?

Thanks.
 
Old 05-26-2015, 12:14 PM   #4
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
Post the Dockerfile when you get home.
I don't believe the "FROM ubuntu:15.04" in it is correct.
And there may be some other stuff missing from your post.
I checked PluralSite but was unwilling to sign up.
Apache is dead easy on Docker.
I did a pull of ubuntu's official image and I only get
DISTRIB_DESCRIPTION="Ubuntu 14.04.2 LTS"

You post the Dockerfile and I can troubleshoot it further.
 
Old 05-26-2015, 12:25 PM   #5
sndlt
Member
 
Registered: Jun 2014
Posts: 55

Original Poster
Rep: Reputation: Disabled
Thanks for your time.

I just checked the pluralsight course module again and that Dockerfile I posted in original post is correct.

I've had other Dockerfile(s) that included "FROM ubuntu:15.04" and they worked fine.

It's just the apache part that's having trouble.

Hmm.. but I'm curious what "docker images nigel1" will yield.

Thanks again and please see my update later.
 
Old 05-26-2015, 12:44 PM   #6
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
No worries.

Subscribed with interest...
 
Old 05-26-2015, 12:56 PM   #7
sndlt
Member
 
Registered: Jun 2014
Posts: 55

Original Poster
Rep: Reputation: Disabled
Thanks.

haha, actually I just re-produced the problem at work. But this one includes a proxy.
I did some web search and seems "FROM ubuntu:15.04" syntax is correct.
Here's the updated Dockerfile and "docker image" output.

--------------------------------
FROM ubuntu:15.04

ENV http_proxy <http://www-proxy.work.com:80>
ENV https_proxy <http://www-proxy.work.com:80>

RUN apt-get update && apt-get install -y iputils-ping apache2

ENV var1=Nigel var2=Poulton

ENTRYPOINT ["apache2ctl"]

--------------------------------

[root@puppetmaster hw]# docker images
REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE
nigel1 latest 6c99781406e3 4 minutes ago 243.4 MB
ubuntu 15.04 bd94ae587483 3 weeks ago 131.3 MB
[root@puppetmaster hw]# docker images nigel1
REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE
nigel1 latest 6c99781406e3 5 minutes ago 243.4 MB
[root@puppetmaster hw]#


Thanks again for your time.
 
Old 05-26-2015, 02:45 PM   #8
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
installing 15.04 Desktop now.
I'll update my results...
 
Old 05-26-2015, 03:47 PM   #9
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
OK.
I told you there was stuff missing

vm.local:
Code:
### Description:	Ubuntu 15.04
### Codename:	        vivid

Code:
vi /dbuilds/apache2/Dockerfile # I used these to build and run the image/container.
FROM ubuntu:15.04

RUN apt-get update && apt-get install -y iputils-ping apache2

ENV var1=Nigel var2=Poulton

EXPOSE 80

ENTRYPOINT ["/usr/sbin/apache2ctl","-DFOREGROUND"]
Built is using
Code:
docker build -t="nigel1:vJJ" .
ran it:
Code:
docker run -it -d --name LQRocks aeaa40ae6938
Verified it's running:
Code:
docker ps 
CONTAINER ID        IMAGE                 COMMAND                CREATED             STATUS              PORTS               NAMES
4a2bcb907510        aeaa40ae6938:latest   "/usr/sbin/apache2ct   35 seconds ago      Up 34 seconds       80/tcp              LQRocks
Verified the docker logs for the container:
Code:
docker logs 4a2bcb907510
spits out
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.17.0.12. Set the 'ServerName' directive globally to suppress this message

a non-fatal error and easily correctable.
That's all I have, for now.

Is the purpose of this course you taking, has the theme of the current instruction center around debugging?
Because without an EXPOSE directive to open the port, it was doomed to fail.

Also
apache2ctl has to run in the foreground for the container to have a writable state.
Code:
ENTRYPOINT ["/usr/sbin/apache2ctl","-DFOREGROUND"]
and to serve up the default /var/www/html/index.html in the container.

Last edited by Habitual; 05-26-2015 at 03:51 PM.
 
1 members found this post helpful.
Old 05-26-2015, 04:05 PM   #10
sndlt
Member
 
Registered: Jun 2014
Posts: 55

Original Poster
Rep: Reputation: Disabled
Course is called "Docker Deep Dive" and in "Diving Deeper with Dockerfile" module and in "ENV Instruction" lesson.

I modified the Dockerfile with EXPOSE and your ENTRYPOINT. It's somewhat running without "/bin/bash"

Are you running all this on a Ubuntu or CentOS server? Can it cause trouble if I try to run Ubuntu Docker image on a CentOS server?

I'll bring this up with the author.

Thanks a lot for your time and effort to try and solve this.

I'll probably post more as I run into troubles. Please continue to stalk me and posts. (might even update this one).

(You must be very smart and also popular at wherever you work).
 
Old 05-26-2015, 04:19 PM   #11
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
Quote:
Originally Posted by sndlt View Post
I modified the Dockerfile with EXPOSE and your ENTRYPOINT. It's somewhat running without "/bin/bash"

Are you running all this on a Ubuntu or CentOS server? Can it cause trouble if I try to run Ubuntu Docker image on a CentOS server?
Ubuntu 15.04/vivid Desktop 64 bit Virtualbox guest.
Quote:
Originally Posted by sndlt View Post
Thanks a lot for your time and effort to try and solve this.
No worries. It's sorta mostly basic stuff and that's all I know atm, the basics.

Quote:
Originally Posted by sndlt View Post
(You must be very smart and also popular at wherever you work).
What I don't know could fill a warehouse,
What I do know could fill an outhouse.

Not that smart. I make plenty of mistakes, believe you me.
The key is fixing more than I break.

If you get in a spot just shoot me an IM/PM here and ask me to take a look. I usually have enough time
to do a build and step through something.

I did 3 docker HOWTOs over here...
Nothing fancy, I just wanted a feel for it, and those are the results.

Peace out!

PS. If you want bash to run in the container, use
Code:
ENTRYPOINT ["/bin/bash"]
or even a
CMD directive using
Code:
CMD "/bin/bash"
or a slight (syntax) variation, eg: something like that.

But if you run /bin/bash, and you enter the container, you have to detach from it for the container to stay running.
Since bash is the command holding the container 'open', you have to detach, not 'exit'.

Reference:
https://docs.docker.com/reference/builder/

Last edited by Habitual; 05-26-2015 at 04:39 PM.
 
Old 05-26-2015, 06:21 PM   #12
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
Quote:
Originally Posted by sndlt View Post
Are you running all this on a Ubuntu or CentOS server? Can it cause trouble if I try to run Ubuntu Docker image on a CentOS server?
I use the same Dockerfiles on either OS.
Running an Ubuntu container in a CentOS environment is perfectly fine, or vice versa for that matter.
 
Old 05-26-2015, 07:11 PM   #13
sndlt
Member
 
Registered: Jun 2014
Posts: 55

Original Poster
Rep: Reputation: Disabled
Hmm, some are saying Ubuntu docker images should run on an Ubuntu host.

By the way, I sent you a friend request.

How do you PM in this website?

Do you know automation tools like Puppet too?
 
Old 05-27-2015, 07:44 AM   #14
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
Quote:
Originally Posted by sndlt View Post
Hmm, some are saying Ubuntu docker images should run on an Ubuntu host.
I'd like to see that reference.

Quote:
Originally Posted by sndlt View Post
By the way, I sent you a friend request.
Got it.

Quote:
Originally Posted by sndlt View Post
How do you PM in this website?
Try this

Quote:
Originally Posted by sndlt View Post
Do you know automation tools like Puppet too?
No, I do not. No puppet, no chef, no ansible.
Doesn't mean I won't need those skills, as we are a Managed Service Provider and our flagship product (AppLogic) is EOL at the end of June.

So, things are about to get interesting where I work.
 
Old 05-27-2015, 08:37 AM   #15
sndlt
Member
 
Registered: Jun 2014
Posts: 55

Original Poster
Rep: Reputation: Disabled
Hmm, I don't have permission to access that page to PM.

Can you send me a PM with your AIM or any messenger ID? if not, we can just talk on this forum.

Oh and by the way, reviewed the Docker course again and turns out I was supposed to comment out the last tine (LOL)
Peace!
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Docker Engine 1.6 Debuts Alongside Docker Registry 2.0 and Compose 1.2.0 LXer Syndicated Linux News 0 04-17-2015 09:02 PM
LXer: Red Hat partners with Docker to create Linux/Docker software stack LXer Syndicated Linux News 0 03-12-2015 05:54 PM
LXer: Ubuntu LXD: Not a Docker replacement, a Docker enhancement LXer Syndicated Linux News 0 11-05-2014 08:40 PM
LXer: Using Clocker and Apache Brooklyn to build a Docker cloud LXer Syndicated Linux News 0 08-20-2014 11:30 PM
how do i go about starting my apache and mysql on UBUNTU $Linuxnoob Ubuntu 3 09-19-2006 06:22 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 11:17 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration