yum update //系统版本更新 vim /etc/yum.repos.d/docker.repo //添加以下内容 [dockerrepo] name=Docker Repository baseurl=https://yum.dockerproject.org/repo/main/centos/7/ enabled=1 gpgcheck=1 gpgkey=https://yum.dockerproject.org/gpg //下面安装 Docker 引擎 yum install docker-engine -y //安装docker引擎,此步也可作为更新docker版本的操作:先#systemctl stop docker 停止docker服务,再#yum install docker-engine 更新docker版本 systemctl enable docker.service systemctl start docker //启动docker守护进程 docker info //查看docker运行情况 docker -v //查看版本信息
chmod +x /usr/local/bin/docker-compose
docker-compose --version
docker-compose version 1.17.1, build 6d101fb
wget --no-check-certificate [url=https://pypi.python.org/packages/source/s/setuptools/setuptools-1.4.2.tar.gztar]https://pypi.python.org/packages/source/s/setuptools/setuptools-1.4.2.tar.gz tar[/url] -vxf setuptools-1.4.2.tar.gz cd setuptools-1.4.2 python2.7 setup.py install //因为服务器自带 Python 2.7 easy_install-2.7 pip
pip install docker-compose docker-compose --version //测试安装是否成功
wget [url=https://github.com/vmware/harbor/releases/download/v1.1.2/harbor-offline-installer-v1.1.2.tgz]https://github.com/vmware/harbor/releases/download/v1.1.2/harbor-offline-installer-v1.1.2.tgz [/url]#离线安装包,也是龟速,把这个下载链接用迅雷下载,速度却贼快,嘿嘿,然后再传到服务器上去,整个过程快很多! tar -zxvf harbor-offline-installer-v1.1.2.tgz
## Configuration file of Harbor # hostname设置访问地址,可以使用ip、域名,不可以设置为127.0.0.1或localhost hostname = 115.159.227.249 #这里我先配置我的服务器IP地址 # 访问协议,默认是http,也可以设置https,如果设置https,则nginx ssl需要设置on ui_url_protocol = http # mysql数据库root用户默认密码root123,实际使用时修改下 db_password = root123 #Maximum number of job workers in job service max_job_workers = 3 #Determine whether or not to generate certificate for the registry's token. #If the value is on, the prepare script creates new root cert and private key #for generating token to access the registry. If the value is off the default key/cert will be used. #This flag also controls the creation of the notary signer's cert. customize_crt = on #The path of cert and key files for nginx, they are applied only the protocol is set to https ssl_cert = /data/cert/server.crt ssl_cert_key = /data/cert/server.key #The path of secretkey storage secretkey_path = /data #Admiral's url, comment this attribute, or set its value to NA when Harbor is standalone admiral_url = NA #NOTES: The properties between BEGIN INITIAL PROPERTIES and END INITIAL PROPERTIES #only take effect in the first boot, the subsequent changes of these properties #should be performed on web ui #************************BEGIN INITIAL PROPERTIES************************ #Email account settings for sending out password resetting emails. #Email server uses the given username and password to authenticate on TLS connections to host and act as identity. #Identity left blank to act as username. email_identity = email_server = smtp.mydomain.com email_server_port = 25 email_username = sample_admin@mydomain.com email_password = abc email_from = admin <sample_admin@mydomain.com> email_ssl = false ##The initial password of Harbor admin, only works for the first time when Harbor starts. #It has no effect after the first launch of Harbor. # 启动Harbor后,管理员UI登录的密码,默认是Harbor12345 harbor_admin_password = Harbor12345 # 认证方式,这里支持多种认证方式,如LADP、本次存储、数据库认证。默认是db_auth,mysql数据库认证 auth_mode = db_auth #The url for an ldap endpoint. ldap_url = [url=]ldaps://ldap.mydomain.com #A[/url] user's DN who has the permission to search the LDAP/AD server. #If your LDAP/AD server does not support anonymous search, you should configure this DN and ldap_search_pwd. #ldap_searchdn = uid=searchuser,ou=people,dc=mydomain,dc=com #the password of the ldap_searchdn #ldap_search_pwd = password #The base DN from which to look up a user in LDAP/AD ldap_basedn = ou=people,dc=mydomain,dc=com #Search filter for LDAP/AD, make sure the syntax of the filter is correct. #ldap_filter = (objectClass=person) # The attribute used in a search to match a user, it could be uid, cn, email, sAMAccountName or other attributes de pending on your LDAP/AD ldap_uid = uid #the scope to search for users, 1-LDAP_SCOPE_BASE, 2-LDAP_SCOPE_ONELEVEL, 3-LDAP_SCOPE_SUBTREE ldap_scope = 3 #Timeout (in seconds) when connecting to an LDAP Server. The default value (and most reasonable) is 5 seconds. ldap_timeout = 5 # 是否开启自注册 self_registration = on # Token有效时间,默认30分钟 token_expiration = 30 # 用户创建项目权限控制,默认是everyone(所有人),也可以设置为adminonly(只能管理员) project_creation_restriction = everyone #Determine whether the job service should verify the ssl cert when it connects to a remote registry. #Set this flag to off when the remote registry uses a self-signed or untrusted certificate. verify_remote_cert = on #************************END INITIAL PROPERTIES************************
vim /usr/lib/systemd/system/docker.service #里面的这行修改为:(其实就是添加 --insecure-registry 115.159.227.249 ) ExecStart=/usr/bin/dockerd --insecure-registry 115.159.227.249
systemctl daemon-reload && systemctl enable docker && systemctl start docker
service docker start
admin登录 $ docker login 115.159.227.249 Username: admin Password: Login Succeeded
docker tag ubuntu:15.10 115.159.227.249/library/ubuntu:15.10 //给我的镜像打个 tag docker push 115.159.227.249/library/ubuntu The push refers to a repository [115.159.227.249/library/ubuntu] 98d59071f692: Pushed af288f00b8a7: Pushed 4b955941a4d0: Pushed f121afdbbd5d: Pushed 15.10: digest: sha256:ec89c4a90f45f5e103860191890f48d8379e0504a2881ff706aef0768dc0321b size: 1150
机械节能产品生产企业官网模板...
大气智能家居家具装修装饰类企业通用网站模板...
礼品公司网站模板
宽屏简约大气婚纱摄影影楼模板...
蓝白WAP手机综合医院类整站源码(独立后台)...苏ICP备2024110244号-2 苏公网安备32050702011978号 增值电信业务经营许可证编号:苏B2-20251499 | Copyright 2018 - 2025 源码网商城 (www.ymwmall.com) 版权所有