Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
小 白蛋
Rancher
Commits
020f0dee
Commit
020f0dee
authored
10 years ago
by
Darren
Browse files
Options
Download
Plain Diff
Merge pull request #128 from ibuildthecloud/pidns
Use host pid namespace for rancher agent
parents
61ea6227
d69d81d2
v2.0-tp1
13fe36e
branch-v1.6.14
branch-v1.6.18
havelina
storage
v1.0
v1.1
v1.2
v1.3
v1.4
v1.5
v1.6
Tags unavailable
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
agent/Dockerfile
+2
-2
agent/Dockerfile
agent/run.sh
+4
-2
agent/run.sh
with
6 additions
and
4 deletions
+6
-4
agent/Dockerfile
+
2
-
2
View file @
020f0dee
...
...
@@ -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
This diff is collapsed.
Click to expand it.
agent/run.sh
+
4
-
2
View file @
020f0dee
...
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Projects
Groups
Snippets
Help