Skip to content

Commit

Permalink
docker: renamed alias docker_shell_into_container
Browse files Browse the repository at this point in the history
  • Loading branch information
davidandreoletti committed Jun 4, 2024
1 parent c8119cc commit 383228c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .oh-my-shell/shellrc/plugins/docker/aliases.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ alias docker_show_containers_in_network="f_docker_showContainersInNetwork $1"

# SSH into a running docker container
# Usage: docker_ssh_into_container "my-container-name", where my-container-name is taken from docker ps's CONTAINER NAME column
alias docker_ssh_into_container="f_docker_SSHIntoContainer "
alias docker_shell_into_container="f_docker_ShellIntoContainer "

# Usage: docker_prune_specific_dangling_images_layer <image_id>
alias docker_prune_specific_dangling_images_layer="docker rmi "
Expand Down
4 changes: 2 additions & 2 deletions .oh-my-shell/shellrc/plugins/docker/functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ f_docker_showContainersInNetwork() {
docker network inspect $1 -f "{{json .Containers }}"
}

f_docker_SSHIntoContainer() {
f_docker_ShellIntoContainer() {
local containerName="$1"
local dockerContainerID="$(docker ps -a | grep \"$containerName\" | cut -d ' ' -f 1)"
local dockerContainerID="$(docker ps -a | grep $containerName | cut -d ' ' -f 1)"
docker exec -it "$dockerContainerID" /bin/sh
}

Expand Down

0 comments on commit 383228c

Please sign in to comment.