-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
doc(devbox): add fqa in devbox doc #5289
Merged
Merged
Changes from 1 commit
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
473638d
doc(devbox): add fqa in devbox doc
cbluebird e066007
doc(devbox): fix the devbox faq lint
cbluebird 9955db1
doc(devbox): add en devbox faq
cbluebird 7ce26ec
doc(devbox): fix the port range in devbox faq
cbluebird c101c60
doc(devbox): fix the devbox faq lint
cbluebird File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -71,4 +71,69 @@ upstream connect error or disconnect/reset before headers. retried and the lates | |
|
||
## 6、本地 localhost 能打开项目但是公网地址打不开 | ||
|
||
代码里暴露地址由于网络原因必须从 `localhost` 改为 `0.0.0.0`。 | ||
代码里暴露地址由于网络原因必须从 `localhost` 改为 `0.0.0.0`。 | ||
|
||
## 7、在Devbox中可以正常运行程序,但是在发版之后,程序无法正常运行 | ||
|
||
在发版之前请确保能在终端中运行entrypoint.sh(这是推荐的发版后的启动脚本),如果需要公网服务,也请同时检查公网地址是否联通. | ||
|
||
```bash | ||
./entrypoint.sh | ||
``` | ||
|
||
如果遇到下面的问题 | ||
|
||
```bash | ||
bash: ./entrypoint.sh: Permission denied | ||
``` | ||
|
||
可以在终端中输入如下的命令,并再次运行entrypoint脚本,并确保结果与期望的相同 | ||
|
||
```bash | ||
sudo chmod +x entrypoint.sh | ||
``` | ||
|
||
同时,建议先在devbox中预先构建完项目代码后并测试,测试成功后再发版,这可以有效避免在发版后的启动时的错误和oom问题 | ||
|
||
## 8、应用程序监听的端口为1-100时,应用程序启动失败 | ||
|
||
在使用devbox时,本地编辑器(vscode、cursor等) | ||
默认的用户为devbox,使用1-100端口是root用户的特权.如果需要正常使用,请使用root权限运行你的程序吗,例如在go的devbox中,可以使用下面的命令. | ||
|
||
```bash | ||
sudo go run main.go | ||
``` | ||
|
||
或者变更你的端口. | ||
|
||
## 9、如何在devbox中更换默认的用户为root用户 | ||
|
||
如果你需要在打开本地编辑器时,链接到devbox的用户为root,可以参考以下的步骤. | ||
首先请确保你的devbox在使用默认的配置时,可以正常连接. | ||
打开本地电脑的`~/.ssh/sealos/devbox_config`,如果不清楚这个文件在哪里,请参考问题2. | ||
|
||
找到你需要切换为root用户的配置,例如 | ||
|
||
```config | ||
Host usw.sailos.io_ns-rqtny6y6_devbox1234 | ||
HostName usw.sailos.io | ||
User devbox | ||
Port 40911 | ||
IdentityFile ~/.ssh/sealos/usw.sailos.io_ns-rqtny6y6_devbox1234 | ||
IdentitiesOnly yes | ||
StrictHostKeyChecking no | ||
``` | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 感觉 |
||
修改`User`为`root`,例如: | ||
|
||
```config | ||
Host usw.sailos.io_ns-rqtny6y6_devbox1234 | ||
HostName usw.sailos.io | ||
User root | ||
Port 40911 | ||
IdentityFile ~/.ssh/sealos/usw.sailos.io_ns-rqtny6y6_devbox1234 | ||
IdentitiesOnly yes | ||
StrictHostKeyChecking no | ||
``` | ||
|
||
保存之后退出打开了devbox的本地编辑器,重新打开编辑器,连接到devbox,此时的用户已经切换为root. |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
中英文之间加一个空格,中文句子的符号也使用中文格式(逗号、句号和括号等)。