-
Delete all containers
$ docker ps -q -a | xargs docker rm
-q prints only the container IDs -a prints all containers
Notice that it uses xargs to issue a remove container command for each container ID
- Delete all untagged images
/** | |
* Back button listener. | |
* Will close the application if the back button pressed twice. | |
*/ | |
@Override | |
public void onBackPressed() | |
{ | |
if(backButtonCount >= 1) | |
{ | |
Intent intent = new Intent(Intent.ACTION_MAIN); |
mkdir test | |
cd test | |
echo "# test_repo" >> README.md | |
cat README.md | |
ls | |
git init | |
ls -la | |
git status | |
git add README.md | |
git commit -m "initial commit" |
class Animal { | |
private String mSpecies = "None"; | |
public void talk() { | |
printf(""); | |
} | |
public String getSpecies() { | |
return mSpecies; | |
} | |
} |
// We create the "Animal" function first. | |
function Animal() { | |
this.species = "None"; | |
this.getSpecies() { | |
return this.species; | |
} | |
} | |
// Now, we create a "dog" function. Notice that there is no indication of inheritance. | |
function Dog() { |
var reverseString = function(stringToReverse) { | |
var finalString = ""; | |
// Our code to reverse the string goes here. | |
return finalString; | |
} |
var reverseString = function(stringToReverse) { | |
var finalString = []; // I prefer to use arrays instead of strings. | |
// loop through the string, starting at the end. | |
// push the character at the current index into the finalString array | |
// Join the characters in the array into a string and return the string. | |
} |
var reverseString = function(stringToReverse) { | |
var finalString = []; // I prefer to use arrays instead of strings. | |
// loop through the string, starting at the end. | |
for (var i = stringToReverse.length; i > 0; i--) { | |
// push the character at the current index into the finalString array | |
finalString.push(stringToReverse[i]); | |
} | |
// Join the characters in the array into a string and return the string. | |
return finalString.join(''); | |
} |
Delete all containers
$ docker ps -q -a | xargs docker rm
-q prints only the container IDs -a prints all containers
Notice that it uses xargs to issue a remove container command for each container ID
docker rmi $( docker images -q -f dangling=true) |
I just worked out another flow to have Zero downtime (mainly for web apps). | |
Proxy | |
We use jwilder/nginx-proxy to handle routing to app servers, this will assist us in dynamically routing requests to services. | |
First Deploy | |
For the first deploy run docker-compose --project-name=app-0001 up -d. |