一、harbor启动报错
harbor 报错:dial tcp 127.0.0.1:1514: connect: connection refused
二、docker ps 查看docker 服务
1、查看到harbor-log 处于restart状态
2、查看harbor-log日志
unable to change expired
password: Authentication token manipulation error sudo:
Account or password isexpired, reset your password and try again sudo: a terminal is required toreadthe password;
either use the -S option to read from standard input or configure
an askpass helper Changing passwordfor root. sudo: unable to change expired
password: Authentication token manipulation error
从报错日志中分析到harbor-log中提示root用户名密码已过期.
三、解决方案
1、导出harbor-log容器
mkdir -p /tmp/harbor-log
cd /tmp/harbor-log
docker export harbor-log -o harbor-log.tar
2、解压tar包
tar xvfp harbor-log.tar
3、修改shadow文件的值
sed -i 's/:90:/:99999:/g' /tmp/harbor-log/etc/shadow
4、将修改后的shadow文件挂载到harbor-log容器内
mkdir -p /opt/harbor-log-etc/
cp /tmp/harbor-log/etc/shadow /opt/harbor-log-etc/shadow
5、修改docker-composr.yml文件,harbor-log容器的volumes配置,增加以下配置
volumes:
- type: bind
source: /opt/harbor-log-etc/shadow
target: /etc/shadow
6、重启harbor即可
docker-compose down
docker-compose up -d