Skip to content

Instantly share code, notes, and snippets.

@rajamodu
rajamodu / create-docker-tls.sh
Created February 2, 2022 14:27 — forked from Stono/create-docker-tls.sh
Creating and setting up Docker for TLS
#!/bin/bash
# This script will help you setup Docker for TLS authentication.
# Run it passing in the arguement for the FQDN of your docker server
#
# For example:
# ./create-docker-tls.sh myhost.docker.com
#
# The script will also create a profile.d (if it exists) entry
# which configures your docker client to use TLS
#
@rajamodu
rajamodu / docker-api-port.md
Created January 27, 2022 14:13 — forked from styblope/docker-api-port.md
Enable TCP port 2375 for external connection to Docker

Enable TCP port 2375 for external connection to Docker

See this issue.
Docker best practise to Control and configure Docker with systemd.

  1. Create daemon.json file in /etc/docker:

     {"hosts": ["tcp://0.0.0.0:2375", "unix:///var/run/docker.sock"]}
    
@rajamodu
rajamodu / crontab.cron
Created January 10, 2022 13:38 — forked from zealot128/crontab.cron
Omnibus Gitlab backup cronjob
# Crontab
# once per week backup, move to "/backup" gzip it, delete everything but the latest 5 files
0 4 * * 1 /opt/gitlab/bin/gitlab-ci-rake gitlab:backup:create CRON=1 && mv /var/opt/gitlab/backups/* /backup/ && cd /backup && gzip *.tar && rm `ls -t | awk 'NR>5'`
@rajamodu
rajamodu / docker_registry_setup.md
Created July 15, 2021 21:53 — forked from narutaro/docker_registry_setup.md
Docker registry with basic auth and SSL certificate

Docker registry with basic auth and SSL certificate

Docker registry does not have authentication nor certificate mechanism so in case you have docker registry on the internet, you need something that support those in front of the registry. You can find examples using Nginx for it on the web and this is yet another one.

The architecture

Client talks to Nginx. Nginx proxies the request to the docker registry. The nginx is on the host OS - not as a container.

+-----------+     +--------------------------------------------------------+
|           |     |  Server                              Docker container  |
@rajamodu
rajamodu / daemon.json
Created July 12, 2021 09:52
Example Docker daemon.json
{
"api-cors-header": "",
"authorization-plugins": [],
"bip": "",
"bridge": "",
"cgroup-parent": "",
"cluster-store": "",
"cluster-store-opts": {},
"cluster-advertise": "",
"debug": true,
@rajamodu
rajamodu / nexus-v3-traefik-v2-docker-compose.yml
Created July 12, 2021 07:03 — forked from ismailyenigul/nexus-v3-traefik-v2-docker-compose.yml
Deploy nexus repository OSS v3 with docker ( traefik v2 and docker-compose)
#1. Create a volume directory for nexus-data. I used /nexus-data directory which is mount point of the second disk
# mkdir /nexus-data
# chown -R 200 /nexus-data #nexus user id 200 in dockerfile
#Create a letsencrypt directory to store traefik acme.json file which keeps SSL certs
# mkdir -p /docker/letsencrypt
#Change NEXUS.mydomain.com with your domain name.
#Change acme.email=MYEMAIL@gmail.com
# cat docker-compose.yml
@rajamodu
rajamodu / caddy-install-guide.md
Created July 10, 2021 10:41 — forked from coocheenin/caddy-install-guide.md
This is in-depth guide how to install a Caddy web server as service, that running from regular unprivileged user.

How to install and configure Caddy, a modern web server, running as a service on CentOS 6.8. You will also obtain a free SSL-Certificate for a website automatically.

This is in-depth guide how to install a modern web server named Caddy as service, that running from regular unprivileged user. You will also obtain a Free SSL-Certificate for a Website automatically.

Why Caddy?

Apache and Nginx are the two most common web servers in the world. Apache is a classical solution, but due to it's memory consumption (because to it's nature of creating a new process for each request) we will leave it for another occasion. Nginx is very fast and the RAM consumption is very-very low, if we need to serve static pages. But Nginx's configuration is not to easy read and understand, this is why we will try more flexible and clear solution, which is more intended for newbies.

Caddy is written is Go, open-source and pretty fast web server. If you're looking for low-memory solution the Cadd

@rajamodu
rajamodu / dynamic.yaml
Created February 10, 2021 11:20 — forked from Mau5Machine/dynamic.yaml
Traefik Dynamic Configuration File
## Setting up the middleware for redirect to https ##
http:
middlewares:
redirect:
redirectScheme:
scheme: https
@rajamodu
rajamodu / docker-compose.yml
Created February 10, 2021 11:20 — forked from Mau5Machine/docker-compose.yml
Traefik Configuration and Setup
version: "3.3"
services:
################################################
#### Traefik Proxy Setup #####
###############################################
traefik:
image: traefik:v2.0
restart: always
@rajamodu
rajamodu / gitlab-backup-to-minio.md
Created December 4, 2020 09:57 — forked from ansemjo/gitlab-backup-to-minio.md
upload gitlab omnibus backups to minio

setup Minio somewhere

Minio is an object storage server compatible with the S3 protocol. Head to https://minio.io/ to learn more.

Hint: You might want to use MINIO_WORM=on to pretect against accidental or malicious deletion of your backups.

seperate users with iam policies

Since RELEASE.2018-10-18T00-28-58Z minio supports seperate users with attached IAM policies. Instead of (or additionally to) using MINIO_WORM=on you could create a new user and attach a writeonly policy: