Skip to content

Instantly share code, notes, and snippets.

View AlexNik's full-sized avatar
😉

Alexander Nikolaev AlexNik

😉
View GitHub Profile
#### NOTE STACK MUST BE CREATED WITH: --with-registry-auth E.g.:
docker stack deploy mystack --compose-file /home/user/mystack/mystack.yaml --with-registry-auth
##### Create authentication username and password and store it in your docker config location, just because #####
mkdir --parents /etc/docker/registry/auth && cd "$_"
docker run --rm --entrypoint htpasswd registry:2.7.0 -Bbn myusername thisismypassword >htpasswd
# Create certificates, assuming 1st node's (the one with the registry container and the primary builder) FQDN is: node1.domain.local
mkdir --parents /etc/docker/registry/certs && cd "$_"
openssl genrsa -aes256 -out domain.key 4096

Более удобной и актуальной версией является эта статья с использованием traefik

https://gist.github.com/dancheskus/365e9bc49a73908302af19882a86ce52


Certbot и nginx, как обратный прокси в Docker (пример с 2 react проектами)

В результате будет 2 react проекта на 1 сервере доступных по разным ссылкам

@AlexNik
AlexNik / Astra_Docker.md
Created April 27, 2020 21:33 — forked from daznext/Astra_Docker.md
Install Docker on AstraLinux Orel

Обновляемся

apt update && apt upgrade

Ставим docker

sudo apt-get install apt-transport-https ca-certificates curl gnupg2 
https://www.thegeekstuff.com/2010/06/bash-array-tutorial/
http://wiki.bash-hackers.org/commands/classictest
https://www.ibm.com/developerworks/ru/library/l-bash-test/
https://www.tutorialkart.com/bash-shell-scripting/check-if-variable-is-set/
http://www.opennet.ru/docs/RUS/bash_scripting_guide/c2171.html
https://coder-booster.ru/learning/linux-beginners/conditional-operator-if-in-bash
https://habr.com/sandbox/102954/
https://habr.com/ru/company/ruvds/blog/327248/