portainer使用二进制文件安装

2023-10-27

一.安装portainer

1.1 查看portainer版本信息

版本信息

可在此查看到每个版本的详细信息

1.2 下载文件

下载并将二进制文件

[root@localhost opt]# wget https://github.com/portainer/portainer/releases/download/1.20.1/portainer-1.20.1-linux-amd64.tar.gz
--2019-03-05 13:21:00--  https://github.com/portainer/portainer/releases/download/1.20.1/portainer-1.20.1-linux-amd64.tar.gz
正在解析主机 github.com (github.com)... 13.229.188.59, 52.74.223.119, 13.250.177.223
正在连接 github.com (github.com)|13.229.188.59|:443... 已连接。
已发出 HTTP 请求,正在等待回应... 302 Found
位置:https://github-production-release-asset-2e65be.s3.amazonaws.com/59239347/7e700400-255c-11e9-9e54-5044865ea28f?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20190305%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20190305T052100Z&X-Amz-Expires=300&X-Amz-Signature=d728457eff5f21815f5ca5c64d3bcace5f8b850ecb66d80785f01de9ce4bf383&X-Amz-SignedHeaders=host&actor_id=0&response-content-disposition=attachment%3B%20filename%3Dportainer-1.20.1-linux-amd64.tar.gz&response-content-type=application%2Foctet-stream [跟随至新的 URL]
--2019-03-05 13:21:01--  https://github-production-release-asset-2e65be.s3.amazonaws.com/59239347/7e700400-255c-11e9-9e54-5044865ea28f?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20190305%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20190305T052100Z&X-Amz-Expires=300&X-Amz-Signature=d728457eff5f21815f5ca5c64d3bcace5f8b850ecb66d80785f01de9ce4bf383&X-Amz-SignedHeaders=host&actor_id=0&response-content-disposition=attachment%3B%20filename%3Dportainer-1.20.1-linux-amd64.tar.gz&response-content-type=application%2Foctet-stream
正在解析主机 github-production-release-asset-2e65be.s3.amazonaws.com (github-production-release-asset-2e65be.s3.amazonaws.com)... 52.216.132.163
正在连接 github-production-release-asset-2e65be.s3.amazonaws.com (github-production-release-asset-2e65be.s3.amazonaws.com)|52.216.132.163|:443... 已连接。
已发出 HTTP 请求,正在等待回应... 200 OK
长度:21945155 (21M) [application/octet-stream]
正在保存至: “portainer-1.20.1-linux-amd64.tar.gz”

100%[==========================================================================================>] 21,945,155   570KB/s 用时 2m 1s  

2019-03-05 13:23:04 (177 KB/s) - 已保存 “portainer-1.20.1-linux-amd64.tar.gz” [21945155/21945155])

1.3 解压文件

解压缩到磁盘上的某个位置

[root@localhost opt]# tar zxvf portainer-1.20.1-linux-amd64.tar.gz 

[root@localhost opt]# ls
portainer

1.4 新建portainer数据存储目录

Portainer默认会尝试将其数据写入/ data文件夹,但我们可以更改它的数据存储目录

[root@localhost opt]# mkdir /opt/portainer-data

1.5 启动portainer

[root@localhost opt]# cd portainer
[root@localhost portainer]# ls
docker  portainer  public  templates.json

启动portainer
[root@localhost portainer]#  ./portainer --data /opt/portainer-data --template-file "${PWD}/templates.json" &
[1] 7824
[root@localhost portainer]# 2019/03/05 13:49:51 Starting Portainer 1.20.1 on :9000

[root@localhost portainer]# cd /opt/portainer-data/
[root@localhost portainer-data]# ls
bin  compose  config.json  portainer.db  portainer.key  portainer.pub  tls

注意:

如果portainer的默认端口9000在你的服务器已经被占用或者不方便使用,也使用该-p标志在另一个端口上为Portainer提供服务:

如下例:

[root@localhost portainer]#  ./portainer --data /opt/portainer-data  -p :8080 --template-file "${PWD}/templates.json" &
[1] 7949

[root@localhost portainer]# 2019/03/05 13:57:37 Templates already registered inside the database. Skipping template import.
2019/03/05 13:57:37 Starting Portainer 1.20.1 on :8080

[root@localhost portainer]# 
[root@localhost portainer]# netstat -lnptu
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name    
tcp6       0      0 :::8080                 :::*                    LISTEN      7949/./portainer

注意:

可以在启动容器的时候直接在命令内设置参数,来修改portainer的默认行为,可使用的参数使用./portainer --help命令查看:

[root@localhost portainer]# ./portainer --help
usage: portainer [<flags>]

Flags:
      --help                     Show context-sensitive help (also try --help-long and --help-man).
      --version                  Show application version.
  -p, --bind=":9000"             Address and port to serve Portainer
  -a, --assets="./"              Path to the assets
  -d, --data="/data"             Path to the folder where the data is stored
  -H, --host=HOST                Endpoint URL
      --external-endpoints=EXTERNAL-ENDPOINTS  
                                 Path to a file defining available endpoints
      --no-auth                  Disable authentication
      --no-analytics             Disable Analytics in app
      --tlsverify                TLS support
      --tlsskipverify            Disable TLS server verification
      --tlscacert="/certs/ca.pem"  
                                 Path to the CA
      --tlscert="/certs/cert.pem"  
                                 Path to the TLS certificate file
      --tlskey="/certs/key.pem"  Path to the TLS key
      --ssl                      Secure Portainer instance using SSL
      --sslcert="/certs/portainer.crt"  
                                 Path to the SSL certificate used to secure the Portainer instance
      --sslkey="/certs/portainer.key"  
                                 Path to the SSL key used to secure the Portainer instance
      --sync-interval="60s"      Duration between each synchronization via the external endpoints source
      --snapshot                 Start a background job to create endpoint snapshots
      --snapshot-interval="5m"   Duration between each endpoint snapshot job
      --admin-password=ADMIN-PASSWORD  
                                 Hashed admin password
      --admin-password-file=ADMIN-PASSWORD-FILE  
                                 Path to the file containing the password for the admin user
  -l, --hide-label=HIDE-LABEL ...  
                                 Hide containers with a specific label in the UI
      --logo=LOGO                URL for the logo displayed in the UI
  -t, --templates=TEMPLATES      URL to the templates definitions.
      --template-file="/templates.json"  
                                 Path to the templates (app) definitions on the filesystem

二、portminer模板

portainer中可以自定义一些模板,然后在portainer中创建容器的时候使用这些模块快速的创建,模板是json格式的,包含一些必选项和可选项。

可看见在启动portminer时,添加的一个参数:–template-file “${PWD}/templates.json”
portminer模板便存储在templates.json文件中

摘取一段templates.json文件中的内容为大家解释一下

2.1 portminer模板样例
[root@localhost portainer]# ls
docker  portainer  public  templates.json
[root@localhost portainer]# cat templates.json 
[
  {
    "type": 1,
    "title": "Registry",
    "description": "Docker image registry",
    "categories": ["docker"],
    "platform": "linux",
    "logo": "https://portainer-io-assets.sfo2.digitaloceanspaces.com/logos/registry.png",
    "image": "registry:latest",
    "ports": [
      "5000/tcp"
    ],
    "volumes": [{ "container": "/var/lib/registry"}]
  },
  {
    "type": 1,
    "title": "Nginx",
    "description": "High performance web server",
    "categories": ["webserver"],
    "platform": "linux",
    "logo": "https://portainer-io-assets.sfo2.digitaloceanspaces.com/logos/nginx.png",
    "image": "nginx:latest",
    "ports": [
      "80/tcp",
      "443/tcp"
    ],
    "volumes": [{"container": "/etc/nginx"}, {"container": "/usr/share/nginx/html"}]
  },

2.2 portminer模板解释

type 必选项,1表示container,2表示swarm stack,3表示compose stack

title 必选项

description 必选项,该镜像描述

image 必选项,该应用使用的docker镜像

administrator_only 可选项,是否只有管理员可用模板

name 可选项,该模板在管理界面中显示的名称

logo 可选项,自定义的logo

registry 可选项,docker镜像的仓库,默认是Dockerhub

command 可选项,容器里面运行的命令,如果没有指定,则默认运行dockerfile的command

network 可选项,模板使用的网络

volumes 可选项,模板使用的volume

ports 可选项,模板exposed的端口

labels 可选项,模板上定义的labels

privileged 可选项,容器是否能在超级权限启动

interactive 可选项,容器启动时是否是交互模式,即添加-i -t

restart_policy 可选项,容器的重启策略

hostname 可选项,容器的主机名

note 可选项,关于模板的信息

platform 可选项,支持的平台,一般是linux或者windows

categories 可选项,模板的类别,可以在UI上通过category来过滤


本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

portainer使用二进制文件安装 的相关文章

随机推荐

  • 安装cuda 11 ,cudnn,pytorch 1.7

    安装cuda cudann pytorch 1 安装cuda 先康康电脑里面有没有 nvcc V 结果当然是没有 要安装首选需要康康自己的显卡能支持到多少的cuda 打开这个 可以通过搜索直接搜到 点击系统信息 在组件栏可以发现我的电脑支持
  • JAVA调用R语言

    编程程序调用R语言之前 需要通过R控制台打开服务器 需要导入这两个包 import org rosuda REngine REXP import org rosuda REngine REXPMismatchException import
  • 角焊缝缺陷_坡口全熔透焊缝必须是一级焊缝吗?

    十年前笔者去精工钢构加工厂参观 参观的项目是某个火车站站房屋顶钢结构 设计单位要求钢框架梁 民用建筑 不需要考虑疲劳 翼缘与腹板的焊接采用坡口全熔透焊缝 且焊缝质量等级为一级 焊接工人在单边坡口焊完一侧焊缝后 用碳弧气刨的方式在另一侧清根
  • 【Linux】网络编程基础

    文章目录 网络基础 1 网络与操作系统的关系 2 计算机网络发展 3 协议 3 1协议分层 3 2OS七层模型 3 3TCP IP五层模型 4 网络传输基本流程 4 1数据包的封装和分用 4 1 1报头和有效载荷 4 2局域网的两台主机通信
  • C#之删除数据库的数据(删)

    private void button3 Click object sender EventArgs e try string id dataGridView1 SelectedRows 0 Cells 0 Value ToString 获
  • BlocProvider add数据流程

    我们看看往bloc中添加数据流程 以demo为例 void incrementCounter counter BlocProvider of
  • TCP协议的三次握手(为了建立连接)

    TCP协议的三次握手 为了建立连接 第一次握手 客户端 Client 向服务器端 Server 发送连接请求 等待服务器端确认 在这一次 客户端会发送一个含SYN同步标志的 TCP报文 SYN同步报文会指明客户端使用的端口以及TCP连接的初
  • Prometheus-Alertmanager 警报管理器-通知模版

    文章目录 一 通知模版介绍 二 模板中可用的数据结构 1 数据 Data 2 告警 Alert 3 KV 4 方法 三 定义可重用模版 一 通知模版介绍 发送给接收方的通知是通过模板构建的 警报管理器附带默认模板 但也可以自定义它们 为避免
  • AndroidStudio升级问题

    前言 今天开这篇文章记录之后遇到AndroidStudio升级或BUG问题 Android Studio Dolphin 2021 3 1 Patch 1 升级 无法运行项目 Android Studio Dolphin 2021 3 1
  • 【源码+文档】绘制太阳系之C语言

    一 实验任务 绘制出一个太阳系 要求 1 有详细的计算步骤 2 至少包含太阳 地球和月亮 3 用 OpenGL 进行绘制 Bonus 1 用代码实现出可执行的实例 2 绘制出行星的轨道 二 原理和分析 1 OpenGL 材质和光照 Open
  • CSS宽度问题

    一 魔法 为 DOM 设置宽度有哪些方式呢 最常用的是配置width属性 width属性在配置时 也有多种方式 width min width max width 通常当配置了 width 时 不会再配置min width max widt
  • 【华为OD机试真题 C语言】48、 寻找身高相近的小朋友

    文章目录 一 题目 题目描述 输入输出 样例1 二 思路参考 三 代码参考 作者 鲨鱼狼臧 个人博客首页 鲨鱼狼臧 专栏介绍 2023华为OD机试真题 使用C语言进行解答 专栏每篇文章都包括真题 思路参考 代码分析 订阅有问题后续可与博主解
  • 基于深度学习实现以图搜图功能

    前记 深度学习的发展使得在此之前以机器学习为主流算法的相关实现变得简单 而且准确率更高 效果更好 在图像检索这一块儿 目前有谷歌的以图搜图 百度的以图搜图 而百度以图搜图的关键技术叫做 感知哈希算法 这是一个很简单且快速的算法 其原理在于针
  • 滚蛋吧,正则表达式!

    大家好 我是良许 不知道大家有没有被正则表达式支配过的恐惧 看着一行火星文一样的表达式 虽然每一个字符都认识 但放在一起直接就让人蒙圈了 你是不是也有这样的操作 比如你需要使用 电子邮箱正则表达式 首先想到的就是直接百度上搜索一个 然后采用
  • 数据名称:中国家庭追踪调查(CFPS)数据区县码数据描述:162个区县代码,适用于10-20年份,可匹配约85-90%的样本。可依次匹配coutyid-区县行政码code-地级市行政码city-省份

    数据名称 中国家庭追踪调查 CFPS 数据区县码 数据描述 162个区县代码 适用于10 20年份 可匹配约85 90 的样本 可依次匹配coutyid 区县行政码code 地级市行政码city 省份行政码province 从而进行市或县层
  • JAVA线程究竟有几种状态?

    线程状态 线程的状态 在你 度的过程中 你会发现 答案有5种 6种 甚至还有7种的 那么究竟有几种状态 准确答案就是6种 在编译器JDK1 5以后的环境下 打开Thread进入源码看看 A thread state A thread can
  • 关于python类说法正确的是_关于Python的说法正确的是

    判断题 1 5压强是大量分子对器壁碰撞的结果 具有统计意义 单选题 1 10 在常温下有1mol的氢气和1mol的氦气各一瓶 若将它们升高相同的温度 则 单选题 1 8 单选题 2 8 一容积不变的容器内充有一定量的某种理想气体 将该理想气
  • c++中struct构造函数

    构造函数 说白了 就是初始化 具体的打法是这个样子的 struct node 构造函数 node 形参表 内容 例子 struct node node int c x c y z 0 int x y z 当然 他既然作为一个函数 那么在里面
  • Leetcode 11. Container With Most Water

    如何盛最大的水 数组代表高度 盛的水量V min height left height right 底部的长度 right left 双指针解决这个问题 从左边 右边不断逼近 逐渐取得最大值 如何进行更新 不断进行更新逼近 因为决定的是he
  • portainer使用二进制文件安装

    一 安装portainer 1 1 查看portainer版本信息 版本信息 可在此查看到每个版本的详细信息 1 2 下载文件 下载并将二进制文件 root localhost opt wget https github com porta