上次介绍的那个容器,docker貌似被禁了,最近又恢复了,所以又 可 以 白嫖了哈哈哈
次教程参考 https://www.hostloc.com/forum.php?mod=viewthread&tid=666136&highlight=shell 可能部分人进不去,没权限
ssh我没办法实现,因为只有一个端口
我是通过noVNC跑的shell,以下是镜像
onsol/centos-xfce-vnc
consol/ubuntu-xfce-vnc
consol/centos-icewm-vnc
consol/ubuntu-icewm-vnc
他们默认进入不是是root
我用了傻瓜方法
在Google shell 上以root用户运行容器加
--user 0
(https://hub.docker.com/r/consol/ubuntu-xfce-vnc/ 详情页有说明)
然后保存镜像 上传到自己仓库
最后到okteto去部署自己的镜像,端口6901
部署成功后浏览器
https://xxxxxx-xxxx.cloud.okteto.net/?password=vncpassword
进入桌面,可以开shell了
这里已经有大佬搭建好的仓库了,直接复制就OK
fallfor/ubuntuvnc
效果图
还可以上谷歌,shell等的很牛逼
一下为宝塔安装教程,参考教程(完全照搬哈哈哈https://www.hostloc.com/forum.php?mod=viewthread&tid=667527&highlight=%E5%AE%9D%E5%A1%94
安装原话:
一些说明:由于现在没法直接容器部署,所以第一步要麻烦一点,需要下载okteto 及 kubectl
okteto下载地址:https://downloads.okteto.com/cli/okteto.exe
kubectl下载地址:https://storage.googleapis.com/kubernetes-release/release/v1.18.0/bin/windows/amd64/kubectl.exe
其他平台请查看 https://okteto.com/docs/getting-started/index.html
https://kubernetes.io/docs/tasks/tools/install-kubectl/
一、宝塔安装:
1、cli登录
okteto login
okteto namespace
2、新建一个文件.yml 如bt.yml
apiVersion: apps/v1
kind: Deployment
metadata:
name: bt-app
spec:
replicas: 1
selector:
matchLabels:
app: bt-app
template:
metadata:
labels:
app: bt-app
spec:
containers:
- image: pch18/baota:clear
name: bt-app
---
apiVersion: v1
kind: Service
metadata:
name: bt-app
annotations:
dev.okteto.com/auto-ingress: "true"
spec:
type: ClusterIP
ports:
- name: "http-port-tcp"
port: 8888
selector:
app: bt-app
3、提交
kubectl apply -f bt.yml
等待完成即可, 登录地址:自动生成 用户名:username 密码 password
二、建站反代
1、新增 Repositories https://charts.bitnami.com
2、新建Applications 选择nginx 修改部分配置
这个我试过了,我貌似卡在最后一个nginx设置,这个一直报错
体验:shell挺爽的,还可以看某些奇妙的网站,宝塔感觉没啥用,因为暂时还不能绑定域名
更新
更新:okteto貌似可以搞了(2020/7/20/)
安装其他镜像的说明:将bt.yml文件的name随意更换,image: pch18/baota:clear 更换为其他容器,port: 8888
端口改为容器内暴露端口,重新推送就是
kubectl apply -f ****.yml