Essential Docker Compose Commands

Launch in background docker-compose up -d If you want to rebuild docker images you can use --build flag after up command. This is essentially same as you would write: # docker build . # docker run myimage docker-compose up --build Stop containers docker-compose down List running images on containers docker-compose ps


Tagging docker images

Normally with "docker build . " you get docker id that you can run with "docker run DOCKERID" but if you want a bit more friendly name you can tag it like this: docker build -t YOURDOCKERUSERNAME/PROJECT:latest . After that you can refer to the image with the tag instead of id like this docker [...]

Create, Run and Delete Container from Dockerfile

First, lets make a simple "hello world" that runs and outputs nodejs command from the container. STEP 1 Create folder and put following files on the folder: Dockerfile # Specify a base image FROM node:alpine WORKDIR '/app' # Install some dependencies COPY ./package.json ./ RUN npm install COPY ./ ./ # Default command CMD ["npm", "start"] package.json {   "dependencies": {     "express": "*"   },   "scripts": {     "start": "node index.js"   } } index.js const express = require('express'); const app = express(); app.get('/', (req, res) => res.send('Hello World!')) app.listen(8081, () => {   console.log('Listening on port 8081'); }); This will [...]

Essential Docker Commands

Containers Use docker container my_command create — Create a container from an image. start — Start an existing container. run — Create a new container and start it. ps — List running containers. inspect — See lots of info about a container. logs — Print logs. stop — Gracefully stop running container. kill —Stop main process in container abruptly. rm— Delete a stopped container. Images [...]

YouTube channels to learn Electronics and Hardware

Enjoy some of YouTube's best educational channels run by “edutainers” and see for yourself how they can spark your curiosity for learning more online: Electronics and hardware Louis Rossmann Louis Rossman Routinely shows bench scope detail of him doing circuit troubleshooting and replace of "no user serviceable parts" modern surface mount Apple stuff, but in the [...]

Restart Application Pool in Powershell and write it to EventLog

Sometimes on Continuous Integration or other automated scenarios you want to restart Application pool in order to recycle everything clean. This can be done by calling Powershell command Restart-WebAppPool like this: "Restart-WebAppPool AppPoolNameHere". But you might also want to write log entry to EventLogs so you know what is going on. In order to write [...]

Restart Windows in 1 hour or certain time

tldr; Open Powershell as Admin Type: Start-Sleep 3600 ; Restart-Computer -Confirm:$false <enter>   I work on RDP a lot against Windows Machines and sometimes there are updates and downloads what I need to do and afterwards update. Or perhaps I need to restart in certain time. Basically what start-sleep does is pause the process for the number [...]