我看到的错误是
awk: fatal: cannot open file '/root/.ssh/authorized_keys'
以下是完整输出:
网站似乎仍能正常运行。需要担心吗?我需要做些什么吗?
如果我没记错的话,那是我们过去使用的一个旧模板的遗留物,当时还没有 docker exec -it bash 这个命令。
您可以安全地忽略它,但如果觉得碍眼,也可以从您的 app.yml 中删除相关行。
可能是哪一行?
如果您在此处分享您的 app.yml,我们或许能准确告知具体是哪些文件。
再次你好 @Falco!
这是我 app.yml 的部分内容(已移除敏感信息):
templates:
- "templates/redis.template.yml"
- "templates/postgres.template.yml"
- "templates/sshd.template.yml"
- "templates/web.template.yml"
- "templates/web.ssl.template.yml"
- "templates/web.letsencrypt.ssl.template.yml"
- "templates/web.ratelimited.template.yml"
expose:
- "2222:22" # 将主机端口 2222 转发到容器端口 22 (ssh)
- "80:80" # 将主机端口 80 转发到容器端口 80 (http)
- "443:443" # 将主机端口 443 转发到容器端口 443 (https)
params:
db_default_text_search_config: "pg_catalog.english"
env:
DISCOURSE_REFRESH_MAXMIND_DB_DURING_PRECOMPILE_DAYS: 30
LANG: en_US.UTF-8
UNICORN_WORKERS: 2
DISCOURSE_DEVELOPER_EMAILS: "......................."
DISCOURSE_HOSTNAME: "lume.community"
DISCOURSE_SMTP_ADDRESS: "................." # (必填)
DISCOURSE_SMTP_USER_NAME: "....................." # (可选)
DISCOURSE_SMTP_PASSWORD: "...................." # (可选)
DISCOURSE_SMTP_ENABLE_START_TLS: true # (可选,默认为 true)
LETSENCRYPT_ACCOUNT_EMAIL: ".............."
volumes:
- volume:
host: /var/discourse/shared/standalone
guest: /shared
- volume:
host: /var/discourse/shared/standalone/log/var-log
guest: /var/log
hooks:
after_code:
- exec:
cd: $home/plugins
cmd:
- mkdir -p plugins
- git clone https://github.com/discourse/docker_manager.git
after_web_config:
- replace:
filename: /etc/nginx/nginx.conf
from: /sendfile.+on;/
to: |
server_names_hash_bucket_size 64;
sendfile on;
- file:
path: /etc/nginx/conf.d/discourse_redirect_1.conf
contents: |
server {
listen 80;
server_name infamous.gadi.cc;
return 301 $scheme://forums.old-site.io$request_uri;
}
run:
- exec: echo "开始自定义命令"
- exec: awk -F\# '{print $1;}' ~/.ssh/authorized_keys | awk 'BEGIN { print "此容器的授权 SSH 密钥:"; } NF>=2 {print $NF;}'
- exec: echo "结束自定义命令"
请注释掉或删除此模板,然后尝试重新构建。这很可能就是问题所在。
编辑:
错误源自以下行:
你可以注释掉以下行并再次尝试,错误应该会消失。
谢谢!看来这是我接手前任运行该实例时遗留的问题。抱歉让您在这个与 Discourse 无关的问题上浪费了时间。