docker volume create docker-registry-storage
docker run -d -p 5000:5000 --restart=always -e REGISTRY_STORAGE_FILESYSTEM_ROOTDIRECTORY=/registry -v docker-registry-storage:/registry --name registry registry:2
Запускаем выполнение bash в Nginx
Для работы Nginx с FastCGI необходимо установить пакет fcgiwrap
sudo apt-get install fcgiwrap
Читать далее «Запускаем выполнение bash в Nginx» Публикация в локальный репозиторий
docker tag sdss:0.2a docker-registry/sdss:0.2a
docker push docker-registry/sdss:0.2a
Deploy a registry server
https://docs.docker.com/registry/deploying/
Пример API
https://www.baeldung.com/ops/docker-registry-api-list-images-tags
Доступ к ресурсу через авторизацию
docker login -u user -p password private.repository:5000
Для удаления
curl https://docker-registry/v2/my-ubuntu/tags/list
curl -v https://docker-registry/v2/my-ubuntu/manifests/latest -H 'Accept: application/vnd.docker.distribution.manifest.v2+json'
curl -X DELETE https://docker-registry/v2/my-ubuntu/manifests/sha256:a3785f78ab8547ae2710c89e627783cfa7ee7824d3468cae6835c9f4eae23ff7 -v
docker Blob Unknown when pushing to custom registry through apache proxy
Adding these lines to the apache config for this vhost fixed it:
Header add X-Forwarded-Proto "https"
RequestHeader add X-Forwarded-Proto "https"
Error response from daemon: Get «https://registry-1.docker.io/v2/»: proxyconnect tcp: dial tcp 192.168.65.1:3128: connect: connection refused
This problem is solved by following steps:
- Open «Windows Security»;
- Open «App & Browser control»;
- Click «Exploit protection settings» at the bottom;
- Switch to «Program settings» tab;
- Locate «C:\WINDOWS\System32\vmcompute.exe» in the list and expand it;
- You would see the box «system overriding» under «Control Flow Guard (CFG)» is checked, disable it. If what you see is different with description here, maybe what described here is not applicable for you.
Установка docker-ce в Ubuntu 18.04 нарушает подключение к Интернету хоста
/etc/docker/daemon.json
{
"bip": "172.31.0.1/16"
}
systemd-resolve --status
предоставил мне DNS-сервер 192.168.3.56 и ifconfig docker0
выдал мне: inet 192.168.65.2 netmask 255.255.0.0 broadcast 192.168.255.255
Все, что мне нужно было сделать, это добавить / etc / docker / daemon.json, как указано выше, и перезапустите docker
Статьи:
- https://superuser.com/questions/1336567/installing-docker-ce-in-ubuntu-18-04-breaks-internet-connectivity-of-host
- https://forums.docker.com/t/cant-access-internet-after-installing-docker-in-a-fresh-ubuntu-18-04-machine/53416/7
Подключение к контейнеру
docker exec -it containerID /bin/bash
Где containerID — это идентификатор или имя контейнера
Просмотр логов у container
docker logs containername >& logs/myFile.log
Информация о логах хранится в каталоге:
/var/lib/docker/containers/*/*.json
python & postgresql
from sqlalchemy import create_engine, text
import pandas as pd
engine = create_engine('postgresql://user:password@host:5432/dbname')
conn = engine.connect()
query = text("""SELECT * FROM core.sd_settings""")
df = pd.read_sql_query(query, conn)
print(df.head())
conn.close()
Примечание: требуется установка следующих компонентов
# requirements.txt
SQLAlchemy
psycopg2
pandas
# pip install -r requirements.txt