docker-ubuntu-24.04安装openresty1.21.4.3全过程

拉取最新的ubuntu镜像

docker pull ubuntu:latest

 创建启动容器

docker run -it --name 容器名称 -p 8082:8082 镜像id /bin/bash

更换apt-get为阿里云镜像
 

sed -i 's@archive.ubuntu.com/@/mirrors.aliyun.com/@g' /etc/apt/sources.list && apt-get update

创建目录

cd home
mkdir openresty
cd openresty/

安装依赖库

apt-get install wget

apt-get install gcc
apt-get install openssl libssl-dev
apt-get install libpcre3 libpcre3-dev
apt-get install perl make build-essential curl

下载和解压

wget https://openresty.org/download/openresty-1.21.4.3.tar.gz
tar -xzvf openresty-1.21.4.3.tar.gz

编译安装

./configure --prefix=/usr/local/openresty -j4 --with-luajit
gmake
gmake install

设置环境变量

vi /etc/profile
export NGINX_HOME=/usr/local/openresty/nginx
export PATH=${NGINX_HOME}/sbin:$PATH
#保存退出
source /etc/profile

安装luarocks

wget https://luarocks.org/releases/luarocks-3.11.0.tar.gz

tar zxpf luarocks-3.11.0.tar.gz

cd luarocks-3.11.0

./configure --prefix=/usr/local/openresty/luajit --with-lua=/usr/local/openresty/luajit/     --lua-suffix=jit --with-lua-include=/usr/local/openresty/luajit/include/luajit-2.1

make 

make install

vi /etc/profile
#增加
export PATH=$PATH:/usr/local/openresty/luajit/bin

source /etc/profile

  • 2
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
这段命令的作用是: 1. 执行 `source /etc/profile` 命令,使得之前添加的 Go 语言环境变量生效; 2. 执行 `mkdir -p /home/ubuntu/gopath/src/github.com/hyperledger` 命令,创建一个目录用于存放 Hyperledger Fabric 的源代码; 3. 执行 `cd /home/ubuntu/gopath/src/github.com/hyperledger` 命令,切换到 Hyperledger Fabric 代码存放的目录; 4. 执行 `cp /resource/docker-compose /usr/local/bin` 命令,将预设好的 `docker-compose` 文件拷贝到 `/usr/local/bin` 目录下; 5. 执行 `chmod +x /usr/local/bin/docker-compose` 命令,添加可执行权限; 6. 执行 `cp /resource/fabric-samples.tar.gz /home/ubuntu/gopath/src/github.com/hyperledger` 命令,将预设好的 Hyperledger Fabric 样例程序压缩包拷贝到 `github.com/hyperledger` 目录下; 7. 执行 `cd /home/ubuntu/gopath/src/github.com/hyperledger` 命令,切换到 Hyperledger Fabric 样例程序所在的目录; 8. 执行 `tar -xf ./fabric-samples.tar.gz` 命令,解压 Hyperledger Fabric 样例程序压缩包; 9. 执行 `source /etc/profile` 命令,重新加载 Go 语言环境变量; 10. 执行 `cd /home/ubuntu/gopath/src/github.com/hyperledger/fabric-samples/scripts` 命令,切换到 Hyperledger Fabric 样例程序的脚本目录; 11. 执行 `./bootstrap.sh 1.4.0 1.4.0 0.4.14` 命令,安装 Hyperledger Fabric 所需的依赖组件; 12. 执行 `cd /home/ubuntu/gopath/src/github.com/hyperledger/fabric-samples/first-network` 命令,切换到 Hyperledger Fabric 样例程序的第一个网络目录; 13. 执行 `./byfn.sh up -s couchdb` 命令,启动第一个网络,并使用 CouchDB 作为状态数据库; 14. 执行 `docker-compose -f docker-compose-cli.yaml -f docker-compose-couch.yaml -f docker-compose-kafka.yaml start` 命令,启动 Fabric 网络中的 Docker 容器; 15. 执行 `../bin/configtxgen -profile TwoOrgsChannel -outputCreateChannelTx channel-artifacts/test.tx -channelID test` 命令,使用 configtxgen 工具生成通道交易配置文件和创世块配置文件。
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值