Skip to content
Snippets Groups Projects
Commit 47a9527e authored by Montaño Sarria, Andres Felipe's avatar Montaño Sarria, Andres Felipe
Browse files

Redefine rundock command

parent f072f3dc
No related branches found
No related tags found
No related merge requests found
......@@ -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(){
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment