ZQ博客

ZQ博客
学无止境-技术在于分享
  1. 首页
  2. ARM
  3. 正文

ARM架构下使用Docker安装Luckysheet(ARM64)

2023年 6月 20日 1835点热度 1人点赞 0条评论

Luckysheet说明

Luckysheet ,一款纯前端类似excel的在线表格,功能强大、配置简单、完全开源。

特性

  • 格式设置:样式,条件格式,文本对齐及旋转,文本截断、溢出、自动换行,多种数据类型,单元格内多样式
  • 单元格:拖拽,下拉填充,多选区,查找和替换,定位,合并单元格,数据验证
  • 行和列操作:隐藏、插入、删除行或列,冻结,文本分列
  • 操作体验:撤销、重做,复制、粘贴、剪切,快捷键,格式刷,选区拖拽
  • 公式和函数:内置公式,远程公式,自定义公式
  • 表格操作:筛选,排序
  • 增强功能:数据透视表,图表,评论,共享编辑,插入图片,矩阵计算,截图,复制到其他格式,EXCEL导入及导出等
file
file
file

获取代码

使用git获取代码

somken@WIN-IJMLJ74DAAO MINGW64 /d/Demo
$ git version
git version 2.31.1.windows.1

somken@WIN-IJMLJ74DAAO MINGW64 /d/Demo
$ git clone https://gitee.com/mengshukeji/LuckysheetServerStarter.git
Cloning into 'LuckysheetServerStarter'...
remote: Enumerating objects: 54, done.
remote: Counting objects: 100% (54/54), done.
remote: Compressing objects: 100% (29/29), done.
remote: Total 54 (delta 22), reused 54 (delta 22), pack-reused 0
Receiving objects: 100% (54/54), 51.03 MiB | 1.74 MiB/s, done.
Resolving deltas: 100% (22/22), done.

somken@WIN-IJMLJ74DAAO MINGW64 /d/Demo

somken@WIN-IJMLJ74DAAO MINGW64 /d/Demo
$ ls
LuckysheetServerStarter/

somken@WIN-IJMLJ74DAAO MINGW64 /d/Demo
$ ls LuckysheetServerStarter/
LICENSE       README.md           java-server/  postgres/
README-zh.md  docker-compose.yml  nginx/        redis/

文件夹结构

C:\Users\Administrator\Desktop\lsheet>tree /f
│ 
│  docker-compose.yml   #部署文件
│
├─java-server
│      application-dev.yml           #项目配置
│      application.yml                  #项目配置 
│      web-lockysheet-server.jar   #项目
│
├─nginx
│  │  nginx.conf  #nginx配置
│  │
│  ├─html         #nginx静态文件夹
|  |  index.html # Luckysheet demo
|  |
│  └─logs          #nginx日志文件夹
├─postgres
│  │  init.sql      #postgre初始化文件
│  │
│  └─data          #postgres数据文件夹
└─redis
    │  redis.conf   #redis配置文件
    │ 
    ├─data          #redis数据文件夹
    └─logs           #redis日志文件夹

安装基本环境

  • 安装 docker
  • 安装 docker-compose
  • 安装 curl

服务器环境

CPU架构 ARM - 鲲鹏920
操作系统 CentOS8.3

说明

通常,当我们在运行docker-compose的时候,我们在后台使用的是x86_64 CPU处理器指令集。如果我们尝试按照默认的安装说明在运行在arm64上的系统上安装docker compose,就会出现错误。这是因为没有可用于arm64指令集的docker compose二进制文件。

安装docker-compose1(安装失败)

参考:https://devcoops.com/how-to-install-docker-compose-on-arm64/


# sudo curl -L --fail https://github.com/docker/compose/releases/download/1.29.2/run.sh -o /usr/local/bin/docker-compose

# sudo chmod +x /usr/local/bin/docker-compose

# docker-compose
[root@kunpeng-centos ~]# curl -L --fail https://github.com/docker/compose/releases/download/1.29.2/run.sh -o /usr/local/bin/docker-compose
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   612  100   612    0     0    371      0  0:00:01  0:00:01 --:--:--   371
100  2585  100  2585    0     0    973      0  0:00:02  0:00:02 --:--:--  6053
[root@kunpeng-centos ~]# sudo chmod +x /usr/local/bin/docker-compose
[root@kunpeng-centos ~]# docker-compose 
Unable to find image 'docker/compose:1.29.2' locally
1.29.2: Pulling from docker/compose
339de151aab4: Pull complete 
484a7070e879: Pull complete 
6391cb0e5266: Pull complete 
aaaf585806ed: Pull complete 
Digest: sha256:ae66070588c539b965986dc74e9371e3e62ef71668b72a5eed70de111ed3659e
Status: Downloaded newer image for docker/compose:1.29.2
WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
standard_init_linux.go:228: exec user process caused: exec format error
[root@kunpeng-centos ~]# 
[root@kunpeng-centos ~]# docker-compose 
WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
standard_init_linux.go:228: exec user process caused: exec format error
[root@kunpeng-centos ~]# 

安装docker-compose2(成功)

参考:https://github.com/tsitle/dockercompose-binary_and_dockerimage-aarch64_armv7l_x86_x64

下载:https://github.com/tsitle/dockercompose-binary_and_dockerimage-aarch64_armv7l_x86_x64/releases


$ sudo tar xf binary/docker-compose-linux--.tgz -C /usr/local/bin/
$ sudo ln -s /usr/local/bin/docker-compose-linux-- /usr/local/bin/docker-compose

安装过程

[root@kunpeng-centos ~]# tar xf docker-compose-linux-arm64-1.25.0.tgz -C /usr/local/bin/
[root@kunpeng-centos ~]# ls -a /usr/local/bin/
.  ..  docker-compose-linux-arm64-1.25.0
[root@kunpeng-centos ~]# ln -s /usr/local/bin/docker-compose-linux-arm64-1.25.0 /usr/local/bin/docker-compose
[root@kunpeng-centos ~]# docker-compose version
docker-compose version 1.25.0, build 4038169d
docker-py version: 4.1.0
CPython version: 3.6.5
OpenSSL version: OpenSSL 1.1.0f  25 May 2017
[root@kunpeng-centos ~]# 

验证安装

查看版本

[root@kunpeng-centos ~]# docker-compose version
docker-compose version 1.25.0, build 4038169d
docker-py version: 4.1.0
CPython version: 3.6.5
OpenSSL version: OpenSSL 1.1.0f  25 May 2017

执行命令

[root@kunpeng-centos ~]# docker-compose
Define and run multi-container applications with Docker.

Usage:
  docker-compose [-f ...] [options] [COMMAND] [ARGS...]
  docker-compose -h|--help

Options:
  -f, --file FILE             Specify an alternate compose file
                              (default: docker-compose.yml)
  -p, --project-name NAME     Specify an alternate project name
                              (default: directory name)
  --verbose                   Show more output
  --log-level LEVEL           Set log level (DEBUG, INFO, WARNING, ERROR, CRITICAL)
  --no-ansi                   Do not print ANSI control characters
  -v, --version               Print version and exit
  -H, --host HOST             Daemon socket to connect to

  --tls                       Use TLS; implied by --tlsverify
  --tlscacert CA_PATH         Trust certs signed only by this CA
  --tlscert CLIENT_CERT_PATH  Path to TLS certificate file
  --tlskey TLS_KEY_PATH       Path to TLS key file
  --tlsverify                 Use TLS and verify the remote
  --skip-hostname-check       Don't check the daemon's hostname against the
                              name specified in the client certificate
  --project-directory PATH    Specify an alternate working directory
                              (default: the path of the Compose file)
  --compatibility             If set, Compose will attempt to convert keys
                              in v3 files to their non-Swarm equivalent
  --env-file PATH             Specify an alternate environment file

Commands:
  build              Build or rebuild services
  bundle             Generate a Docker bundle from the Compose file
  config             Validate and view the Compose file
  create             Create services
  down               Stop and remove containers, networks, images, and volumes
  events             Receive real time events from containers
  exec               Execute a command in a running container
  help               Get help on a command
  images             List images
  kill               Kill containers
  logs               View output from containers
  pause              Pause services
  port               Print the public port for a port binding
  ps                 List containers
  pull               Pull service images
  push               Push service images
  restart            Restart services
  rm                 Remove stopped containers
  run                Run a one-off command
  scale              Set number of containers for a service
  start              Start services
  stop               Stop services
  top                Display the running processes
  unpause            Unpause services
  up                 Create and start containers
  version            Show the Docker-Compose version information
[root@kunpeng-centos ~]# 

配置安装文件

修改docker-compose.yml

version: "2"
services:

  nginx:
    image: nginx:latest
    #restart: always
    container_name: luckysheet_nginx
    environment:
      - TZ=Asia/Shanghai
    ports:
      - "80:80"
      - "443:443"
    volumes:
      - ./nginx/nginx.conf:/etc/nginx/nginx.conf
      - ./nginx/logs:/var/log/nginx/
      - ./nginx/html:/usr/share/nginx/html/
      - /etc/localtime:/etc/localtime
    networks:
      extnetwork:
        ipv4_address: 172.19.0.101

  redis:
    #image: redis:latest
    image: redis:5.0
    container_name: luckysheet_redis
    #restart: always
    environment:
      - TZ=Asia/Shanghai
    command: redis-server /usr/local/etc/redis/redis.conf --requirepass 123456
    ports:
      - "6379:6379"
    volumes:
      - ./redis/data:/usr/local/redis/data/
      - ./redis/logs:/usr/local/redis/
      - ./redis/redis.conf:/usr/local/etc/redis/redis.conf
      - /etc/localtime:/etc/localtime
    networks:
      extnetwork:
        ipv4_address: 172.19.0.2

  postgres:
    image: postgres:12
    #restart: always
    privileged: true
    container_name: luckysheet_postgres
    ports:
      - 5432:5432
    environment:
      POSTGRES_USER: postgres
      POSTGRES_PASSWORD: 123456
      PGDATA: /var/lib/postgresql/data/pgdata
    volumes:
      - ./postgres/data:/var/lib/postgresql/data/pgdata
      - ./postgres/init.sql:/docker-entrypoint-initdb.d/init.sql
      - /etc/localtime:/etc/localtime
    networks:
      extnetwork:
        ipv4_address: 172.19.0.3

  web-server:
    #image: java:8
    image: openjdk:8u302-jdk
    #restart: always
    privileged: true
    container_name: luckysheet_server
    ports:
      - 9004:9004
    volumes:
      - ./java-server/web-luckysheet-server.jar:/usr/local/luckysheet-server/app.jar
      - ./java-server/application.yml:/usr/local/luckysheet-server/application.yml
      - ./java-server/application-dev.yml:/usr/local/luckysheet-server/application-dev.yml
      - /etc/localtime:/etc/localtime
    command: [
      'java',
      '-Xmx200m',
      '-jar',
      '/usr/local/luckysheet-server/app.jar',
      '--spring.config.location=/usr/local/luckysheet-server/application.yml,/usr/local/luckysheet-server/application-dev.yml'
    ]
    networks:
      extnetwork:
        ipv4_address: 172.19.0.4

networks:
   extnetwork:
      ipam:
         config:
         - subnet: 172.19.0.0/16
           gateway: 172.19.0.1

设置redis/logs目录权限

mkdir ./redis/logs/
chmod a+rwx ./redis/logs/

开始构建生成镜像

docker-compose build
# docker-compose build
nginx uses an image, skipping
redis uses an image, skipping
postgres uses an image, skipping
web-server uses an image, skipping

后台启动容器

docker-compose up -d 
[root@kunpeng-centos LuckysheetServerStarter]# docker-compose up -d 
Creating network "luckysheetserverstarter_extnetwork" with the default driver
Pulling nginx (nginx:latest)...
latest: Pulling from library/nginx
d10c227306ce: Pull complete
3b3450d77825: Pull complete
976f19f897eb: Pull complete
cf2a5bf96bb5: Pull complete
218cda107c30: Pull complete
49f49174f1f4: Pull complete
Digest: sha256:a05b0cdd4fc1be3b224ba9662ebdf98fe44c09c0c9215b45f84344c12867002e
Status: Downloaded newer image for nginx:latest
Pulling redis (redis:latest)...
latest: Pulling from library/redis
d10c227306ce: Already exists
71f6c833430f: Pull complete
f6169272c13d: Pull complete
17db4d790ed8: Pull complete
c5b59ebbf80e: Pull complete
177c4d24fee3: Pull complete
Digest: sha256:e595e79c05c7690f50ef0136acc9d932d65d8b2ce7915d26a68ca3fb41a7db61
Status: Downloaded newer image for redis:latest
Pulling postgres (postgres:12)...
12: Pulling from library/postgres
d10c227306ce: Already exists
f306c6378be8: Pull complete
e195976f82a1: Pull complete
87f2ab1cd2a7: Pull complete
8ea394e4c2e3: Pull complete
13de0f992edb: Pull complete
2a930e5b9b20: Pull complete
6d2e9457138d: Pull complete
42de861c1e4b: Pull complete
a74b8f80496d: Pull complete
ac8a405d4b09: Pull complete
fe48a7e21854: Pull complete
9e8a88e79c00: Pull complete
Digest: sha256:5afbf72bfdb224f9ad3b29dd570747b4752ab2e81e9c25145847004f8a350e60
Status: Downloaded newer image for postgres:12
Pulling web-server (java:8)...
8: Pulling from library/java
5040bd298390: Pull complete
fce5728aad85: Pull complete
76610ec20bf5: Pull complete
60170fec2151: Pull complete
e98f73de8f0d: Pull complete
11f7af24ed9c: Pull complete
49e2d6393f32: Pull complete
bb9cdec9c7f3: Pull complete
Digest: sha256:c1ff613e8ba25833d2e1940da0940c3824f03f802c449f3d1815a66b7f8c0e9d
Status: Downloaded newer image for java:8
Creating luckysheet_redis    ... done
Creating luckysheet_nginx    ... done
Creating luckysheet_server   ... done
Creating luckysheet_postgres ... done
[root@kunpeng-centos LuckysheetServerStarter]# 

查看镜像

docker ps

验证安装

redis验证

# docker exec -it  luckysheet_redis  redis-cli -a '123456'
Warning: Using a password with '-a' or '-u' option on the command line interface may not be safe.
127.0.0.1:6379> ping
PONG
127.0.0.1:6379> keys *
(empty list or set)
127.0.0.1:6379> exit

postgres验证

#进入容器
docker exec -ti luckysheet_postgres /bin/bash
#登陆postgres
psql -U postgres
#列出全部数据库
\l
#切换数据库
\c luckysheetdb
#列出全部表名
\dt
#查看表数据
select * from luckysheet;

验证java应用(使用测试url)

curl http://172.19.0.4:9004/luckysheet/test/constant?param=123

验证nginx访问java应用

curl http://172.19.0.101/luckysheet/test/constant?param=123
标签: Excel Luckysheet 在线表格
最后更新:2023年 6月 20日

zq

每天进步一点, 时间长了你会发现已经走了很远了

点赞
< 上一篇
下一篇 >
分类
  • ARM
  • Docker
  • java
  • Linux
  • OpenStack问题
  • springboot
  • SpringCloud
  • 前端开发
  • 技术分享
  • 数据库
  • 未分类
  • 版本控制
文章目录
  • Luckysheet说明
    • 特性
  • 获取代码
    • 使用git获取代码
    • 文件夹结构
  • 安装基本环境
    • 说明
    • 安装docker-compose1(安装失败)
    • 安装docker-compose2(成功)
    • 验证安装
  • 配置安装文件
    • 修改docker-compose.yml
    • 设置redis/logs目录权限
    • 开始构建生成镜像
  • 后台启动容器
  • 查看镜像
  • 验证安装
    • redis验证
    • postgres验证
    • 验证java应用(使用测试url)
    • 验证nginx访问java应用

COPYRIGHT ©2024 www.dowhere.com ALL RIGHTS RESERVED.and Theme Kratos