openshift - Red Hat CodeReady 容器 - 无法访问 github.com
问题描述
我已经在我的 Mac 上安装并设置了 CodeReady 容器,尝试使用示例节点 js 应用程序创建项目,但构建失败并在日志中显示此消息。
我们是否需要对 CodeReady 容器进行任何更改才能访问 github.com ?
Cloning "https://github.com/sclorg/nodejs-ex.git" ...
error: fatal: unable to access 'https://github.com/sclorg/nodejs-ex.git/': Could not resolve host: github.com
解决方案
我在 crc 上试过你的命令。它对我有用。不需要额外的步骤。
$ oc new-app https://github.com/sclorg/nodejs-ex
--> Found image db4e490 (2 months old) in image stream "openshift/nodejs" under
...
...
Run 'oc status' to view your app.
我假设您可以从笔记本电脑访问 github.com。:)
看看能不能从 crc 虚拟机解析 GitHub。
从您的笔记本电脑。
$ host api.crc.testing
$ ssh -i ~/.crc/machines/crc/id_rsa core@192.168.130.11
现在检查您是否可以解决github
[root@crc-fdm75-master-0 ~]$ host github.com
github.com has address 13.234.210.38
github.com mail is handled by 1 aspmx.l.google.com.
github.com mail is handled by 10 alt3.aspmx.l.google.com.
github.com mail is handled by 10 alt4.aspmx.l.google.com.
github.com mail is handled by 5 alt1.aspmx.l.google.com.
github.com mail is handled by 5 alt2.aspmx.l.google.com.
如果它不起作用,那么您的安装有问题。尝试再次进行全新设置。
crc stop
crc clean-up
crc setup
crc start
让我们看看情况如何。
顺便说一句,我使用 Fedora,而不是 mac。我认为操作系统在这里无关紧要。
推荐阅读
- excel - 如何测试范围是否为空白?
- powershell - 如何从字符串中获取2个值
- node.js - Vuex 对象状态是正确的,但在尝试检索时显示未定义
- php - $_SERVER['HTTP_USER_AGENT'] 在本地主机和服务器上不同
- c - STRUCT c编程中的字母冒泡排序
- react-native - 如何使用 Expo 修复 React Native Navigation - Haste 模块地图中不存在模块“react-native-gesture-handler”
- javascript - Angular 7 - 承诺内的 forEach 迭代在承诺解决后执行。为什么?
- java - 正则表达式:匹配任何字符a,特定字符b,然后再匹配a
- c++ - 通过PID以编程方式杀死进程的方法
- jquery - 根据在各种选择输入中选择的选项隐藏和显示警告消息