| 32 | | == イメージのプッシュ |
| | 32 | == イメージのプッシュ(内部レジストリ) |
| | 33 | {{{ |
| | 34 | ■内部レジストリのURL確認 |
| | 35 | [root@os-master1 ~]# oc login -u system:admin |
| | 36 | Logged into "https://os-master1.local:8443" as "system:admin" using existing credentials. |
| | 37 | |
| | 38 | You have access to the following projects and can switch between them with 'oc project <projectname>': |
| | 39 | |
| | 40 | * common |
| | 41 | default |
| | 42 | kube-public |
| | 43 | kube-service-catalog |
| | 44 | kube-system |
| | 45 | logging |
| | 46 | management-infra |
| | 47 | openshift |
| | 48 | openshift-infra |
| | 49 | openshift-node |
| | 50 | |
| | 51 | Using project "common". |
| | 52 | [root@os-master1 ~]# oc get svc -n default |
| | 53 | NAME CLUSTER-IP EXTERNAL-IP PORT(S) AGE |
| | 54 | docker-registry 172.30.207.150 <none> 5000/TCP 3d |
| | 55 | kubernetes 172.30.0.1 <none> 443/TCP,53/UDP,53/TCP 3d |
| | 56 | registry-console 172.30.108.12 <none> 9000/TCP 3d |
| | 57 | router 172.30.164.49 <none> 80/TCP,443/TCP,1936/TCP 3d |
| | 58 | |
| | 59 | ■イメージのタグを作成 |
| | 60 | # docker tag docker.io/nginx:latest 172.30.207.150:5000/common/nginx:latest |
| | 61 | |
| | 62 | ■一般ユーザ(not system:admin)権限でログインしなおす |
| | 63 | # oc login |
| | 64 | Authentication required for https://os-master1.local:8443 (openshift) |
| | 65 | Username: admin |
| | 66 | Password: |
| | 67 | Login successful. |
| | 68 | |
| | 69 | You have one project on this server: "common" |
| | 70 | |
| | 71 | Using project "common". |
| | 72 | |
| | 73 | ■レジストリにログイン |
| | 74 | # docker login -u $(oc whoami) -p $(oc whoami -t) 172.30.207.150:5000 |
| | 75 | Login Succeeded |
| | 76 | ■プッシュ |
| | 77 | # docker push 172.30.207.150:5000/common/nginx:latest |
| | 78 | }}} |
| | 79 | |
| | 80 | == イメージのプッシュ(外部レジストリ) |