Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
Development_Environment
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
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
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Montaño Sarria, Andres Felipe
Development_Environment
Commits
47a9527e
Commit
47a9527e
authored
2 years ago
by
Montaño Sarria, Andres Felipe
Browse files
Options
Downloads
Patches
Plain Diff
Redefine rundock command
parent
f072f3dc
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
dotfiles/docker.bash
+20
-18
20 additions, 18 deletions
dotfiles/docker.bash
with
20 additions
and
18 deletions
dotfiles/docker.bash
+
20
−
18
View file @
47a9527e
...
...
@@ -7,18 +7,26 @@ alias drmi="docker rmi"
alias
dsp
=
"docker system prune --all"
alias
dimp
=
"docker image prune"
# Build docker image
# usage: dockbuild {noetic, melodic}
function
dockbuild
(){
cd
~/srcs/development_environment/dockerfiles
;
docker build
-t
devenv:
$1
--build-arg
ROS_DISTRO
=
$1
-f
devenv.Dockerfile
.
}
# Run container with rocker
# usage: rundock {noetic, melodic} [{remodel_ws, odin_ws}] [cmd]
# To share docker --volume /var/run/docker.sock:/var/run/docker.sock:ro
function
rundock
()
{
cd
~/ros/
$1
/
$2
;
rocker
--home
--ssh
--git
--user
--nvidia
--x11
--network
host
--name
$1
devenv:
$1
$3
}
# Execute container, move to workspace, and source SHELL
# usage: dat {noetic, melodic} {remodel_ws, odin_ws}
function
dat
()
{
# Check if the container exist
if
[[
$(
docker ps
-aq
-f
name
=
$1
)
]]
;
then
# Attach to conayiner
docker
exec
-it
$1
bash
-c
"cd ~/ros/
$1
/
$2
&&
$ext
"
else
# Launch container
cd
~/ros/
$1
/
$2
;
rocker
--home
--ssh
--git
--user
--privileged
--nvidia
--x11
--network
host
--name
$1
devenv:
$1
$3
fi
}
# Remove all stoped containers
...
...
@@ -26,22 +34,16 @@ function drma() {
drm
$(
docker ps
-a
-f
status
=
exited
-q
)
}
# Stop and remove
function
dsr
()
{
docker stop
$1
;
docker
rm
$1
}
# Remove all unused or dangling immages
function
drmui
(){
drmi
$(
dim
--filter
"dangling=true"
-q
--no-trunc
)
}
# Build docker image
# usage: dockbuild {noetic, melodic}
function
dockbuild
(){
cd
~/srcs/development_environment/dockerfiles
;
docker build
-t
devenv:
$1
--build-arg
ROS_DISTRO
=
$1
-f
devenv.Dockerfile
.
# Stop and remove
function
dsr
()
{
docker stop
$1
;
docker
rm
$1
}
# function runpythonsyntax(){
...
...
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