Last active
March 27, 2026 06:36
-
-
Save zmts/509f224950f85f3cfe4365e2b80081d1 to your computer and use it in GitHub Desktop.
Revisions
-
zmts revised this gist
Jun 25, 2020 . 1 changed file with 7 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -99,6 +99,13 @@ Delete all stopped containers: docker rm $(docker ps -a -q) ``` ### Other Install help utils ``` apt-get install iputils-ping nmap ``` Jump into container shell ``` docker exec -it CONTAINER_ID /bin/sh -
zmts revised this gist
Jun 25, 2020 . 1 changed file with 12 additions and 8 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -51,6 +51,8 @@ CMD [ "node", "./dist/main.js" ] ## Docker commands ### Images Build docker image ``` docker build -t test-image-name . @@ -75,24 +77,26 @@ Remove all images at once docker rmi $(docker images -q) ``` ### Containers List all active containers ``` docker ps ``` List all active and dead containers ``` docker ps -a ``` Stop all running containers ``` docker stop $(docker ps -a -q) ``` Delete all stopped containers: ``` docker rm $(docker ps -a -q) ``` Jump into container shell -
zmts revised this gist
Jun 25, 2020 . 1 changed file with 5 additions and 5 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -70,6 +70,11 @@ List all images docker image ls ``` Remove all images at once ``` docker rmi $(docker images -q) ``` Stop all running containers ``` docker stop $(docker ps -a -q) @@ -80,11 +85,6 @@ Delete all stopped containers: docker rm $(docker ps -a -q) ``` List all active containers ``` docker ps -
zmts revised this gist
Jun 25, 2020 . 1 changed file with 19 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -65,6 +65,25 @@ Or run image in silent(daemon) mode ``` docker run -d -p 7777:7777 test-image-name ``` List all images ``` docker image ls ``` Stop all running containers ``` docker stop $(docker ps -a -q) ``` Delete all stopped containers: ``` docker rm $(docker ps -a -q) ``` Remove all images at once ``` docker rmi $(docker images -q) ``` List all active containers ``` -
zmts revised this gist
Dec 2, 2019 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -17,7 +17,7 @@ ``` "scripts": { "build": "tsc", "start": "node ./dist/main.js" } ``` @@ -46,7 +46,7 @@ RUN npm run build EXPOSE 7777 CMD [ "node", "./dist/main.js" ] ``` ## Docker commands -
zmts created this gist
Nov 27, 2019 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,82 @@ # Docker, TypeScript, Node.js ## Preconditions: - TS application listening port: 7777 ``` |-- dist |-- src |-- .dockerignore |-- Dockerfile |-- package.json |-- package-lock.json `-- tsconfig.json ``` `package.json` scripts ``` "scripts": { "build": "tsc", "start": "NODE_ENV=production node ./dist/main.js" } ``` ## Dockerfile ``` FROM node:10-alpine # update packages RUN apk update # create root application folder WORKDIR /app # copy configs to /app folder COPY package*.json ./ COPY tsconfig.json ./ # copy source code to /app/src folder COPY src /app/src # check files list RUN ls -a RUN npm install RUN npm run build EXPOSE 7777 CMD [ "npm", "start" ] ``` ## Docker commands Build docker image ``` docker build -t test-image-name . ``` Run image in interactive mode ``` docker run -it -p 7777:7777 test-image-name ``` Or run image in silent(daemon) mode ``` docker run -d -p 7777:7777 test-image-name ``` List all active containers ``` docker ps ``` List all active and dead containers ``` docker ps -a ``` Jump into container shell ``` docker exec -it CONTAINER_ID /bin/sh ```