Как выполнить развертывание из докера-концентратора в openshift? - PullRequest
0 голосов
/ 09 мая 2019

Я пытаюсь развернуть образ докера из концентратора докеров в openshift.

Я создал изображение с помощью простого приложения для весенней загрузки: https://hub.docker.com/r/ernst1970/my-rest

После входа в openshift выбрать правильный проект, который я делаю

oc new-app ernst1970/my-rest

И я получаю

W0509 13:17:28.781435   16244 dockerimagelookup.go:220] Docker registry lookup failed: Get https://registry-1.docker.io/v2/: net/http: request canceled while waiting for connection (Clien
t.Timeout exceeded while awaiting headers)                                                                                                                                                 
error: Errors occurred while determining argument types:                                                                                                                                   

ernst1970/my-rest as a local directory pointing to a Git repository:  GetFileAttributesEx ernst1970/my-rest: The system cannot find the path specified.                                    

Errors occurred during resource creation:                                                                                                                                                  
error: no match for "ernst1970/my-rest"                                                                                                                                                    

The 'oc new-app' command will match arguments to the following types:                                                                                                                      

  1. Images tagged into image streams in the current project or the 'openshift' project                                                                                                    
     - if you don't specify a tag, we'll add ':latest'                                                                                                                                     
  2. Images in the Docker Hub, on remote registries, or on the local Docker engine                                                                                                         
  3. Templates in the current project or the 'openshift' project                                                                                                                           
  4. Git repository URLs or local paths that point to Git repositories                                                                                                                     

--allow-missing-images can be used to point to an image that does not exist yet.                                                                                                           

See 'oc new-app -h' for examples.                                                                                                                                                          

Я тоже пробовал с

oc new-app mariadb

Но получил то же сообщение об ошибке.

Я думал, что это может быть проблема с прокси. Поэтому я добавил прокси к своему .profile:

export http_proxy=http://ue73011:secret@dev-proxy.wzu.io:3128
export https_proxy=http://ue73011:secret@dev-proxy.wzu.io:3128

К сожалению, это ничего не изменило.

Есть идеи, почему это не работает?

1 Ответ

1 голос
/ 10 мая 2019

вашему демону docker нужен прокси, чтобы он мог связаться с DockerHub. Вы можете указать прокси-сервер, указав его в качестве переменной среды для демона docker.

Посмотрите официальную документацию Docker: https://docs.docker.com/config/daemon/systemd/

sudo mkdir -p /etc/systemd/system/docker.service.d

Добавить файл / etc / systemd / system / docker.service.d / http-proxy.conf , который должен содержать следующее

[Service]    
Environment="HTTP_PROXY=http://proxy.example.com:80/" "NO_PROXY=localhost,127.0.0.1,docker-registry.example.com,.corp"

Перезагрузите изменения и перезапустите демон Docker

sudo systemctl daemon-reload
sudo systemctl restart docker

Подтвердите, выполнив простое "извлечение докера ..."

...