Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
TFG_Informatica
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
victarr
TFG_Informatica
Commits
83a63598
Commit
83a63598
authored
Jun 10, 2022
by
victarr
Browse files
Options
Downloads
Patches
Plain Diff
Add new file
parent
de28fc3f
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
code/shell_files/dcclean
+23
-0
23 additions, 0 deletions
code/shell_files/dcclean
with
23 additions
and
0 deletions
code/shell_files/dcclean
0 → 100644
+
23
−
0
View file @
83a63598
#!/bin/bash
#
# Removes ALL containers in a given docker instance.
#
# USE WITH CARE
#
# Author: Valentín Cardeñoso Payo
# Date: 2-mar-2022
ME
=
$(
basename
$0
)
CLIST
=
"
$(
docker container
ls
-a
|
cut
-d
' '
-f1
| egrep
".*[0-9].*"
)
"
if
[
"
$CLIST
"
==
""
]
then
echo
-e
"
\n\t
$ME
: There is no container to remove ...
\n
"
exit
1
else
echo
-e
"
\n\t
$ME
: You are about to remove the following containers:"
echo
"
$CLIST
"
|
sed
-e
's: :\n:g'
echo
-e
-n
"
\n\n
Are you sure? [N/y]: "
&&
read
ans
if
[
"
$ans
"
==
"y"
]
then
docker container
rm
-f
$CLIST
else
echo
-e
"
\n\n\t
$ME
: Containers were NOT REMOVED. Exiting."
fi
fi
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