Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't remove optional services #459

Closed
Alexhha opened this issue Dec 22, 2017 · 9 comments
Closed

Can't remove optional services #459

Alexhha opened this issue Dec 22, 2017 · 9 comments
Assignees
Milestone

Comments

@Alexhha
Copy link

Alexhha commented Dec 22, 2017

Hello,

it seems DISABLE_SYSLOG/DISABLE_SSH/DISABLE_CRON doesn't work. I was unable to build base images without those services.

$ git clone https://github.com/phusion/baseimage-docker.git .
$ DISABLE_SYSLOG=1 DISABLE_SSH=1 DISABLE_CRON=1 make NAME=alex/pbi
$ docker build -t alex/pbi:0.9.22 --rm image
Sending build context to Docker daemon 62.98 kB
Step 1/6 : FROM ubuntu:16.04
 ---> 2d696327ab2e
Step 2/6 : MAINTAINER Phusion <info@phusion.nl>
 ---> Running in ed0949279107
...
...
...
Step 5/6 : ENV DEBIAN_FRONTEND "teletype" LANG "en_US.UTF-8" LANGUAGE "en_US:en" LC_ALL "en_US.UTF-8"
 ---> Running in 4d1b27cc5816
 ---> 5f39b42c1198
Removing intermediate container 4d1b27cc5816
Step 6/6 : CMD /sbin/my_init
 ---> Running in 70f2b2b5210e
 ---> eb196e02ff7a
Removing intermediate container 70f2b2b5210e
Successfully built eb196e02ff7a

As you can see from the ps output they are still running

$ docker run -it -d --name pbi-test eb196e02ff7a
8879aaa360c602410cbbea5a0a0188481695aebfad2f981240c12daf9112d257

$ docker exec -it pbi-test ps ax
  PID TTY      STAT   TIME COMMAND
    1 ?        Ss+    0:00 /usr/bin/python3 -u /sbin/my_init
   10 ?        S      0:00 /usr/sbin/syslog-ng --pidfile /var/run/syslog-ng.pid 
   16 ?        S+     0:00 /usr/bin/runsvdir -P /etc/service
   17 ?        Ss     0:00 runsv cron
   18 ?        Ss     0:00 runsv sshd
   19 ?        S      0:00 /usr/sbin/cron -f
   20 ?        Rs+    0:00 ps ax

Did I miss something?

@kingdonb
Copy link
Collaborator

kingdonb commented Jan 3, 2018

According to the docs,

https://github.com/phusion/baseimage-docker#removing-optional-services

this setting should be in ./image/buildconfig (not simply in the environment when you run make.)

Could you try again and let us know if we can close this? Sorry for the delay.

@Theaxiom
Copy link
Collaborator

Closing this, if you continue to encounter issues please let us know. Thanks!

@hyperknot
Copy link
Collaborator

To be honest, buildconfig contains

export DISABLE_SYSLOG=${DISABLE_SYSLOG:-0}
export DISABLE_SSH=${DISABLE_SSH:-0}
export DISABLE_CRON=${DISABLE_CRON:-0}

So it's trying to read them from environment variables at least. If this doesn't work, we should just change them to 1.

@afraca
Copy link

afraca commented Oct 30, 2018

The PR also has unclear wording:
9adbd42

You can user ENV directive in Dockerfile to disable the installation
for some services or change image/buildconfig.

@kingdonb
Copy link
Collaborator

kingdonb commented Nov 4, 2018

That is unclear, "you can user"

Reopening, thanks @afraca

@kingdonb kingdonb reopened this Nov 4, 2018
@kingdonb kingdonb self-assigned this Nov 7, 2018
@rdxmb
Copy link
Contributor

rdxmb commented Nov 15, 2018

To be honest, buildconfig contains

export DISABLE_SYSLOG=${DISABLE_SYSLOG:-0}
export DISABLE_SSH=${DISABLE_SSH:-0}
export DISABLE_CRON=${DISABLE_CRON:-0}

So it's trying to read them from environment variables at least.

No. You have explicitly set them in the docker build - line.
See https://docs.docker.com/engine/reference/commandline/build/#set-build-time-variables---build-arg and #482

@kingdonb
Copy link
Collaborator

That's right @rdxmb, I'll make a PR to clarify this in the documentation. Thanks for the research.

kingdonb pushed a commit to kingdonb/baseimage-docker that referenced this issue Nov 20, 2018
@kingdonb
Copy link
Collaborator

I opened #520 to address this.

@kingdonb
Copy link
Collaborator

We can track this documentation issue at #520 now. Thanks for the clarifications!

Theaxiom added a commit that referenced this issue Nov 26, 2018
addressing the confusion in issue #459
@Theaxiom Theaxiom added this to the 0.11.1 milestone Nov 26, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants