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

Docker + salt-bootstrap failure #394

Closed
JasonSwindle opened this issue May 14, 2014 · 8 comments
Closed

Docker + salt-bootstrap failure #394

JasonSwindle opened this issue May 14, 2014 · 8 comments

Comments

@JasonSwindle
Copy link
Contributor

Howdy,

I am trying to use salt-bootstrap inside of a docker container and I keep getting the following error

Processing triggers for ureadahead (0.100.0-16) ...
 *  INFO: Running install_ubuntu_check_services()
 * ERROR: Failed to run install_ubuntu_check_services()!!!
2014/05/14 23:28:24 The command [/bin/sh -c curl -L http://bootstrap.saltstack.org -o install_salt.sh && sh install_salt.sh -M -N -X] returned a non-zero code: 1
FROM ubuntu:14.04

MAINTAINER Jason Swindle

ENV DEBIAN_FRONTEND noninteractive
ENV TERM linux

## Update the apt database
RUN apt-get update

## Upgrade any packages
RUN apt-get upgrade -y

## Install what we need
RUN apt-get install -y sudo openssh-server curl python-pip

## Install supervisor
RUN pip install supervisor

## Install Salt Master (of Masters)
RUN curl -L http://bootstrap.saltstack.org -o install_salt.sh && sh install_salt.sh -M -N -X

## Remove the apt database
RUN apt-get clean

## Set root's password
RUN echo 'root:fakepassword' | chpasswd

## Make the SSH dir
RUN mkdir /var/run/sshd 

## Make Salt-Master a service
ADD ./salt.conf /etc/supervisor/conf.d/

## Make sshD a service
ADD ./ssh.conf /etc/supervisor/conf.d/

## Not sure if needed in 0.11.1
#EXPOSE 22 4505:4505 4506:4506

CMD ["/usr/bin/supervisord", "-n", "-c", "/etc/supervisor/supervisord.conf"]

Thanks,
Jason

@s0undt3ch
Copy link
Contributor

Yes, this is know, and right now you can't get around it.
The script needs to know that services are starting as supposed, and within docker, which only allows you to start a single process, upstarts is not running so, the services are not properly installed.

@nrgaway
Copy link

nrgaway commented May 15, 2014

I created a shell script that will allow you to install salt via bootstrap in a docker. It just relays the install command and ignores any errors. It will install just fine in Ubuntu and Debian using this script.

https://gist.github.com/nrgaway/277e225bac5e9a6a37b9

@darylyu
Copy link

darylyu commented Oct 1, 2014

@ross-p
Copy link

ross-p commented Nov 14, 2014

No, the problem is an issue with the salt bootstrap. It requires that runlevel is set, but inside a Docker container it is not. There are some PRs to fix the issue, you can use those branches or wait for them to be merged.

@slafs
Copy link

slafs commented Nov 16, 2014

Hello! Any update on this? #455 looks nice if you ask me

@ross-p
Copy link

ross-p commented Nov 17, 2014

#493 fixes the problem.

@dstokes
Copy link

dstokes commented Jan 23, 2015

also

RUN <bootstrap_cmd>; exit 0

@s0undt3ch
Copy link
Contributor

Check services can now be skipped, pass -d

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants