Commit 020f0dee authored by Darren's avatar Darren
Browse files

Merge pull request #128 from ibuildthecloud/pidns

Use host pid namespace for rancher agent
No related merge requests found
Showing with 6 additions and 4 deletions
+6 -4
......@@ -11,7 +11,7 @@ RUN apt-get update && \
RUN curl -s https://bootstrap.pypa.io/get-pip.py > get-pip.py && python get-pip.py && rm get-pip.py
RUN pip install cattle docker-py
RUN curl -s http://stedolan.github.io/jq/download/linux64/jq > /usr/bin/jq; chmod +x /usr/bin/jq
RUN curl -s https://get.docker.io/builds/Linux/x86_64/docker-1.4.1 > /usr/bin/docker; chmod +x /usr/bin/docker
RUN curl -s https://get.docker.io/builds/Linux/x86_64/docker-1.5.0 > /usr/bin/docker; chmod +x /usr/bin/docker
RUN apt-get update && apt-get install -y --no-install-recommends nodejs
RUN mkdir -p /var/lib/cattle /var/lib/rancher
COPY register.py /
......@@ -19,4 +19,4 @@ COPY resolve_url.py /
COPY agent.sh /
COPY run.sh /
ENTRYPOINT ["/run.sh"]
ENV RANCHER_AGENT_IMAGE rancher/agent:v0.3.2
ENV RANCHER_AGENT_IMAGE rancher/agent:v0.4.0
......@@ -102,7 +102,7 @@ verify_docker_client_server_version()
resolve_image()
{
local image=$(docker inspect -f '{{.Image}}' $(hostname))
local image=$(docker inspect -f '{{.Image}}' $(hostname) 2>/dev/null)
if [ -z "$image" ]; then
image=${RANCHER_AGENT_IMAGE:-rancher/agent:latest}
......@@ -155,6 +155,7 @@ setup_state()
export CATTLE_STATE_DIR=/var/lib/cattle/state
export CATTLE_AGENT_LOG_FILE=/var/lib/cattle/logs/agent.log
export CATTLE_CADVISOR_WRAPPER=cadvisor.sh
export CATTLE_AGENT_PIDNS=host
}
load()
......@@ -252,7 +253,7 @@ wait_for()
done
}
DOCKER_OPTS="-d --name rancher-agent --restart=always --net=host"
DOCKER_OPTS="-d --name rancher-agent --restart=always --net=host --pid=host"
if [ "$#" == 0 ]; then
error "One parameter required"
......@@ -266,6 +267,7 @@ if [[ $1 =~ http.* ]]; then
wait_for
cleanup_agent
DOCKER_OPTS="--rm" launch_agent register
sleep 2
elif [ "$1" = "check-var-lib" ]; then
if mkdir -p /var/lib/rancher/state >/dev/null 2>&1; then
echo true
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment