FineUI用了好多年,最近出了FineUICore版本,一直没时间是试一下docker,前几天买了一个腾讯云服务器,1核2g,装了centos7.6,开始的时候主要是整个个人博客,在腾讯云安装了宝塔,宝塔linux面板,web界面一键管理linux服务器,很是方便,没有linux基础的也可以玩linux。

  1. 抛开宝塔,还是用腾讯云的SSH来登陆centos吧:

登陆成功,如果显示这种:

说明22端口没有 开启,需要到腾讯云安全组开启

编辑,把拒绝改成允许并保存。

2、先保证是root登陆,不是的要切换成root,敲命令 uname -a,查看内核版本:

Linux VM_0_6_centos 3.10.0-957.21.3.el7.x86_64 #1 SMP Tue Jun 18 16:35:19 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

  这个其实是无用功,我们已经知道这台腾讯云的centos是7.6版本,装docker是没有问题的,centos6.5也没有问题

3、把yum包更新到最新,如果你事前 把centos 的python2.7更新到最新版本python3.8,那么这个时候更新yum 后会出错,出现错误可以参考:https://www.cnblogs.com/cx55887/p/10538748.html

使用命令:

  

yum update

  

4、安装需要的软件包

yum install -y yum-utils device-mapper-persistent-data lvm2

设置yum源

yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo

5、查看所有仓库中所有docker版本,并选择特定版本安装

Repository epel is listed more than once in the configuration
Loading mirror speeds from cached hostfile
Loaded plugins: fastestmirror, langpacks
Installed Packages
docker-ce.x86_64 3:19.03.4-3.el7 docker-ce-stable
docker-ce.x86_64 3:19.03.3-3.el7 docker-ce-stable
docker-ce.x86_64 3:19.03.2-3.el7 docker-ce-stable
docker-ce.x86_64 3:19.03.1-3.el7 docker-ce-stable
docker-ce.x86_64 3:19.03.0-3.el7 docker-ce-stable
docker-ce.x86_64 3:18.09.9-3.el7 docker-ce-stable
docker-ce.x86_64 3:18.09.8-3.el7 docker-ce-stable
docker-ce.x86_64 3:18.09.7-3.el7 docker-ce-stable
docker-ce.x86_64 3:18.09.6-3.el7 docker-ce-stable
docker-ce.x86_64 3:18.09.5-3.el7 docker-ce-stable
docker-ce.x86_64 3:18.09.4-3.el7 docker-ce-stable
docker-ce.x86_64 3:18.09.3-3.el7 docker-ce-stable
docker-ce.x86_64 3:18.09.2-3.el7 docker-ce-stable
docker-ce.x86_64 3:18.09.1-3.el7 docker-ce-stable
docker-ce.x86_64 3:18.09.0-3.el7 docker-ce-stable
docker-ce.x86_64 18.06.3.ce-3.el7 docker-ce-stable
docker-ce.x86_64 18.06.3.ce-3.el7 @docker-ce-stable
docker-ce.x86_64 18.06.2.ce-3.el7 docker-ce-stable
docker-ce.x86_64 18.06.1.ce-3.el7 docker-ce-stable
docker-ce.x86_64 18.06.0.ce-3.el7 docker-ce-stable
docker-ce.x86_64 18.03.1.ce-1.el7.centos docker-ce-stable
docker-ce.x86_64 18.03.0.ce-1.el7.centos docker-ce-stable
docker-ce.x86_64 17.12.1.ce-1.el7.centos docker-ce-stable
docker-ce.x86_64 17.12.0.ce-1.el7.centos docker-ce-stable
docker-ce.x86_64 17.09.1.ce-1.el7.centos docker-ce-stable
docker-ce.x86_64 17.09.0.ce-1.el7.centos docker-ce-stable
docker-ce.x86_64 17.06.2.ce-1.el7.centos docker-ce-stable
docker-ce.x86_64 17.06.1.ce-1.el7.centos docker-ce-stable
docker-ce.x86_64 17.06.0.ce-1.el7.centos docker-ce-stable
docker-ce.x86_64 17.03.3.ce-1.el7 docker-ce-stable
docker-ce.x86_64 17.03.2.ce-1.el7.centos docker-ce-stable
docker-ce.x86_64 17.03.1.ce-1.el7.centos docker-ce-stable
docker-ce.x86_64 17.03.0.ce-1.el7.centos docker-ce-stable
Available Packages

我选择的是最新版本,使用命令安装docker:

yum install docker-ce-18.06..ce-.el7

等待安装成功,然后,启动docker,并设置开机启动:

systemctl start docker
systemctl enable docker

验证是否安装成功,命令行输入命令: docker version

[root@VM_0_6_centos ~]# docker version
Client:
Version: 18.06.-ce
API version: 1.38
Go version: go1.10.3
Git commit: d7080c1
Built: Wed Feb ::
OS/Arch: linux/amd64
Experimental: false Server:
Engine:
Version: 18.06.-ce
API version: 1.38 (minimum version 1.12)
Go version: go1.10.3
Git commit: d7080c1
Built: Wed Feb ::
OS/Arch: linux/amd64
Experimental: false

6、打开FineUICore_Examples_RazorPages_v6.0.0 源码,修改vs2019自动生成的Dockerfile,这个原来生成的Dockerfile是不能用的,我试过,传到docker上去,生成镜像是运行不了,不晓得什么原因,就是这个Dockerfile:

FROM microsoft/dotnet:2.1-aspnetcore-runtime AS base
WORKDIR /app
EXPOSE FROM microsoft/dotnet:2.1-sdk AS build
WORKDIR /src
COPY ["FineUICore.Examples.RazorPages/FineUICore.Examples.RazorPages.csproj", "FineUICore.Examples.RazorPages/"]
RUN dotnet restore "FineUICore.Examples.RazorPages/FineUICore.Examples.RazorPages.csproj"
COPY . .
WORKDIR "/src/FineUICore.Examples.RazorPages"
RUN dotnet build "FineUICore.Examples.RazorPages.csproj" -c Release -o /app FROM build AS publish
RUN dotnet publish "FineUICore.Examples.RazorPages.csproj" -c Release -o /app FROM base AS final
WORKDIR /app
COPY --from=publish /app .
ENTRYPOINT ["dotnet", "FineUICore.Examples.RazorPages.dll"]

修改成这样的:

FROM microsoft/dotnet:2.1-aspnetcore-runtime AS base
ARG source
WORKDIR /publish
EXPOSE
COPY /. /publish
ENTRYPOINT ["dotnet", "FineUICore.Examples.RazorPages.dll"]

还要把Dockerfile 的复制到输出目录改成:始终复制,保证Dockerfile 会复制到生成目录

然后发布到文件夹:

把这个发布成功的publish里面的文件上传到centos的某个文件夹,我是在centos根目录建了一个叫publish 的文件夹,上传的时候,可以用宝塔安装一个ftp服务端,长这样的:

设置好账号密码,本地下载一个ftp客户端,比如免费的filezilla.exe,很好用,filezilla输入ip,账号密码,上传publish 中的文件

7、上传完成之后,还是用docker生成FineUICore基础版源码的镜像,使用命令:

    docker build -t myfineui .       (注意:最后空格后面有一个.)。

等待生成成功,成功后,查看生成的镜像

[root@VM_0_6_centos ~]# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
myfineui latest 9535b05e8107 hours ago 337MB
alibaba-vica-netcore latest 7190d859989b hours ago 189MB
microsoft/dotnet 2.1-aspnetcore-runtime 190467cc5405 weeks ago 253MB
mcr.microsoft.com/dotnet/core/runtime 3.0-buster-slim b525e32f0752 weeks ago 189MB
portainer/portainer latest 4cda95efb0e4 weeks ago .6MB

可以看到myfineui已经成功生成

8、运行这个镜像myfineui :

docker run --name myfineui  -d -p :  myfineui 

这个意思是,把镜像myfineui 运行起来,并且这个新运行起来的镜像centos容器叫myfineui(第二个),这个容器的端口80,映射到云服务器centos 的8080端口。一个镜像可以run无数个容器,这些容器互不干扰,好似c#里面的类,可以new无数个实例。

最后,云服务器的外网ip加上端口,就可以访问FineUICore基础版了:

本文特别鸣谢狗哥!

FineUICore基础版部署到docker实战的更多相关文章

  1. netcore 创建腾讯云私有镜像 发布到docker 实战

    上一篇博客写的 netcoer上传到docker ,编译 并发布,传送门:FineUICore基础版部署到docker实战 这是一种笨方法,理想的方法是,在本地编译成镜像,然后推送到镜像仓库,服务器的 ...

  2. Docker03 Docker基础知识、Docker实战

    1 Docker基础知识 1.1 什么是Docker Docker是一个可以装应用的容器,就像杯子可以装水.书包可以装书一样:docker官网 Docker是Docker公司开发的,并开源到GitHu ...

  3. Docker实战 | 第二篇:IDEA集成Docker插件实现一键自动打包部署微服务项目,一劳永逸的技术手段值得一试

    一. 前言 大家在自己玩微服务项目的时候,动辄十几个服务,每次修改逐一部署繁琐不说也会浪费越来越多时间,所以本篇整理通过一次性配置实现一键部署微服务,实现真正所谓的一劳永逸. 二. 配置服务器 1. ...

  4. 测试必会 Docker 实战(一):掌握高频命令,夯实内功基础

    在 Dokcer 横空出世之前,应用打包一直是大部分研发团队的痛点.在工作中,面对多种服务,多个服务器,以及多种环境,如果还继续用传统的方式打包部署,会浪费大量时间精力. 在 Docker 出现后,它 ...

  5. Docker(十一):Docker实战部署HTTPS的Tomcat站点

    1.选择基础镜像  docker pull tomcat:7.0-jre8 2.生成HTTPS证书 keytool -genkey -alias tomcat -keyalg RSA -keystor ...

  6. FineUICore(基础版)v5.4.0已发布!

    FineUICore(基础版)已发布,请先加入知识星球,下载后可以永久免费商用:

  7. openstack(pike 版)集群部署(一)----基础环境部署

    一.环境 1.系统: a.CentOS Linux release 7.4.1708 (Core) b.更新yum源和安装常用软件 #  yum -y install  epel-release ba ...

  8. Jenkins部署Python项目实战

    一.背景 我们工作中常用Jenkins部署Java代码,因其灵活的插件特性,例如jdk,maven,ant等使得java项目编译后上线部署一气呵成,同样对于脚本语言类型如Python上线部署,利用Je ...

  9. Docker实战(八)之Web服务与应用

    1.Apache 官方提供了名为httpd的Apache镜像,可以作为基础web服务镜像 Dockerfile(安装apache2) FROM httpd:2.4 COPY ./public-html ...

随机推荐

  1. oc工程中oc、swift混编代码打包成静态framework踩坑笔记

    参考资料: https://www.jianshu.com/p/734341f7c242 https://www.jianshu.com/p/55038871e7de   两天时间探索,期间不知道遇到 ...

  2. MVC参数传递

    MVC参数传递 请求参数自动类型转换 JSP页面 form class="loginForm" action="/user/getUser" method=&q ...

  3. Codeforces-527c

    Leonid wants to become a glass carver (the person who creates beautiful artworks by cutting the glas ...

  4. hdu2546

    Problem Description 电子科大本部食堂的饭卡有一种很诡异的设计,即在购买之前判断余额.如果购买一个商品之前,卡上的剩余金额大于或等于5元,就一定可以购买成功(即使购买后卡上余额为负) ...

  5. CSU oj 2092-Space Golf

    You surely have never heard of this new planet surface exploration scheme, as it is being carried ou ...

  6. 洛谷 题解 P2312 【解方程】

    Problem P2312 [解方程] >>> record 用时: 1166ms 空间: 780KB(0.76MB) 代码长度: 2.95KB 提交记录: R9909587 > ...

  7. C语言之推箱子游戏代码

    前言本文的文字及图片来源于网络,仅供学习.交流使用,不具有任何商业用途,版权归原作者所有,如有问题请及时联系我们以作处理.作者:Yan_Less 正文 新手注意:如果你学习遇到问题找不到人解答,可以点 ...

  8. Orleans 初接触(一) 入门例子

    [返回导航] 在简单了解了Orleans 之后我们可以通过几个例子去加深印象 一.Orleans入门例子 这个例子是跟着<Orleans入门例子>(https://www.cnblogs. ...

  9. ELK 理论小知识

    ELK 是现阶段众多企业单位都在使用的一种日志分析系统,它能够方便的为我们收集你想要的日志并且展示出来 ELK是Elasticsearch.Logstash.Kibana的简称,这三者都是开源软件,通 ...

  10. eclipse配置svn导出项目

    eclipse安装svn 菜单栏help-->eclipse marketspace-->find中搜索subclipse,安装-->ok windows-->show vie ...