Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
turtlebot4
Manage
Activity
Members
Labels
Plan
Issues
6
Issue boards
Milestones
Wiki
Code
Merge requests
1
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
robohub
turtlebot4
Commits
04f06109
There was an error fetching the commit references. Please try again later.
Commit
04f06109
authored
5 months ago
by
Alexander Werner
Browse files
Options
Downloads
Patches
Plain Diff
improve dns server hack
parent
878538f5
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
start.sh
+10
-3
10 additions, 3 deletions
start.sh
with
10 additions
and
3 deletions
start.sh
+
10
−
3
View file @
04f06109
...
...
@@ -90,8 +90,15 @@ if [ -z "${CONTAINER_NAME}" ]; then
CONTAINER_NAME
=
uw_
${
ROBOTNAME
}
_
${
USER
}
fi
docker network create
${
CONTAINER_NAME
}
||
echo
"Network already exists"
echo
${
CONTAINER_NAME
}
docker network
ls
|
grep
-q
${
CONTAINER_NAME
}
||
docker network create
${
CONTAINER_NAME
}
if
[
-f
/run/NetworkManager/resolv.conf
]
;
then
DOCKER_DNS_ARGS
=
"--dns=
$(
cat
/run/NetworkManager/resolv.conf |
grep
nameserver |
sed
-s
"s/nameserver //"
|
head
-n
1
)
"
elif
[
-f
/run/resolvconf/resolv.conf
]
;
then
DOCKER_DNS_ARGS
=
"--dns=
$(
cat
/run/resolvconf/resolv.conf |
grep
nameserver |
sed
-s
"s/nameserver //"
|
head
-n
1
)
"
else
DOCKER_DNS_ARGS
=
"--dns=8.8.8.8"
fi
if
!
docker container ps |
grep
-q
${
CONTAINER_NAME
}
;
then
echo
"Starting new container with name:
${
CONTAINER_NAME
}
"
$DOCKER_COMMAND
run
\
...
...
@@ -105,9 +112,9 @@ if ! docker container ps | grep -q ${CONTAINER_NAME}; then
--cap-add
=
SYS_PTRACE
\
--cap-add
=
SYS_NICE
\
--cap-add
=
NET_ADMIN
\
--dns
=
$(
cat
/run/systemd/resolve/resolv.conf |
grep
nameserver |
sed
-s
"s/nameserver //"
|
head
-n
1
)
\
--device
/dev/bus/usb
\
--device
/dev/net
\
$DOCKER_DNS_ARGS
\
--network
${
CONTAINER_NAME
}
\
$IMAGE_NAME
else
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment