Skip to content

Instantly share code, notes, and snippets.

😃

Hemanth B hemanth22

😃
  • Societe Generale Global Solution Centre.
  • Banglore
Block or report user

Report or block hemanth22

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View programming-quotes.md
@hemanth22
hemanth22 / fib.js
Created Sep 21, 2019 — forked from ry/fib.js
a proper fibonacci server in node. it will light up all your cores.
View fib.js
var http = require('http')
var fork = require('child_process').fork;
function fib(n) {
if (n < 2) {
return 1;
} else {
return fib(n - 2) + fib(n - 1);
}
}
@hemanth22
hemanth22 / docker_commands.md
Created Sep 11, 2019 — forked from 64lines/docker_commands.md
[DOCKER] Docker Useful Commands
View docker_commands.md

Useful Docker commands

docker build -t friendlyname .                                       # Create image using this directory's Dockerfile
docker run -p 4000:80 friendlyname                                   # Run "friendlyname" mapping port 4000 to 80
docker run -d -p 4000:80 friendlyname                                # Same thing, but in detached mode
docker run -d -p 4000:80 -n containername friendlyname               # With the container name
docker run -dit --name apache2 apache2                               # Run in the background
docker ps                                                            # See a list of all running containers
docker stop <hash>                                                   # Gracefully stop the specified container
@hemanth22
hemanth22 / Dockerfile
Created Sep 11, 2019 — forked from arehmandev/Dockerfile
Quick docker in docker
View Dockerfile
FROM debian:stretch-slim
RUN apt-get update -y && apt install -y curl && \
curl -LO https://download.docker.com/linux/debian/dists/stretch/pool/stable/amd64/containerd.io_1.2.6-3_amd64.deb && apt install -f -y ./containerd.io_1.2.6-3_amd64.deb && \
curl -LO https://download.docker.com/linux/debian/dists/stretch/pool/stable/amd64/docker-ce-cli_18.09.7~3-0~debian-stretch_amd64.deb && apt install -f -y ./docker-ce-cli_18.09.7~3-0~debian-stretch_amd64.deb && \
curl -LO https://download.docker.com/linux/debian/dists/stretch/pool/stable/amd64/docker-ce_18.09.7~3-0~debian-stretch_amd64.deb && apt install -f -y ./docker-ce_18.09.7~3-0~debian-stretch_amd64.deb && \
rm -rf *.deb
@hemanth22
hemanth22 / docker_cheatsheet.md
Created Sep 11, 2019 — forked from murarisumit/docker_cheatsheet.md
docker cheatsheet #docker #cheatsheet
View docker_cheatsheet.md

Docker cheatsheet, usually has one-lines to delete containers.

  • Create a image from docker file: docker build -t image-name .
  • Run a container: docker run -it --name container-name image-name:latest
  • Run docker in backgroud: docker run --name container-name --hostname container-hostname -t -d container-name:latest
  • Connect to container: docker exec -it container_name bash
  • Remove all Exited containers: sudo docker ps -a | grep Exit | cut -d ' ' -f 1 | xargs sudo docker rm
  • Remove all dangling images: docker rmi $(docker images -f 'dangling=true' -q)
@hemanth22
hemanth22 / docker_cookbook.md
Created Sep 11, 2019 — forked from Mukei/docker_cookbook.md
[Docker Cookbook] #docker #cookbook
View docker_cookbook.md
@hemanth22
hemanth22 / jenkins-in-docker.md
Created Sep 11, 2019 — forked from afloesch/jenkins-in-docker.md
Jenkins in Docker (docker-in-docker)
View jenkins-in-docker.md

Jenkins in Docker (docker-in-docker)

Testing Jenkins flows on your local machine, or running Jenkins in production in a docker container can be a little tricky with a docker-in-docker scenario. You could install Jenkins to avoid any docker-in-docker issues, but then you have Jenkins on your machine, and the local environment is likely going to be a fairly different from the actual production build servers, which can lead to annoying and time-consuming issues to debug.

Build environment differences are precisely why there is a strong argument to be made to run build processes strictly in docker containers. If we follow the philosophy that every build step or action should run in a docker container, even the Jenkins server itself, then we get massive benefits from things like, total control over the build environment, easily modify the build environment without the possibility of adversely effecting other jobs, explicit and strongly controlled tool versions,

View what_is_docker.md
  • 도커는 컨테이너 기반의 오픈소스 가상화 플랫폼
## List Docker CLI commands
docker
docker container --help

## Display Docker version and info
docker --version
docker version
@hemanth22
hemanth22 / Docker-Commands.md
Created Sep 11, 2019 — forked from elsauto/Docker-Commands.md
Docker Commands #Docker #Docker-Compose
View Docker-Commands.md

Docker Command Cheatsheet

Build our own image:

docker build -t my-image .

Delete All Exited Containers (Linux):

docker rm $(docker ps -q -f status=exited)
@hemanth22
hemanth22 / Cheatsheet.md
Created Sep 11, 2019 — forked from cig0/Cheatsheet.md
Docker #docker
View Cheatsheet.md

Docker cheatsheet

Command Description
Ctrl-p + Ctrl-q Disconnects from current interactive container
docker ps Lists the current running containers
docker images Lists available containers
docker stop Stops the specified container
docker port Lists the ports exposed on the specified container
docker network inspect Displays the net information for the specified container
You can’t perform that action at this time.