Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to get a docker image and create a docker network

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

This article introduces the knowledge of "how to obtain a docker image and create a docker network". In the operation of practical cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

1. Get docker image

The following statement downloads the Ubuntu image that contains the compiled software.

Docker pull eosio/eos

As a quick test, run the mirror and gain access to bash shell, do the following:

Docker run-- rm-it eosio/eos bash

If possible, you should be prompted as follows, and typing cleos should return help from the cleos tool:

Root@a5f9eafaab74:/#cleosERROR: RequiredError: Subcommand requiredCommand Line Interface to EOSIO ClientUsage: cleos [OPTIONS] SUBCOMMANDOptions:-hmermerlyhelp Print this help message and exit-- wallet-url TEXT= http://localhost:8888/ the http/https URL where nodeos is running-- wallet-url TEXT= http://localhost:8888/ the http/https URL where keosd is running-v -- verbose output verbose actions on errorSubcommands: version Retrieve version information create Create various items On and off the blockchain get Retrieve various items and information from the blockchain set Set or update blockchain state transfer Transfer EOS from account to account net Interact with local p2p network connections wallet Interact with local wallet sign Sign a transaction push Push arbitrary transactions to the blockchain multisig Multisig contract commands system Send eosio.system contract action to the blockchain.root@a5f9eafaab74:/#root@a5f9eafaab74:/#exit

Type exit to exit the mirror.

two。 Create a docker network

Create a docker network that allows containers to communicate with each other.

Docker network create eosnetwork3. Run the container

Run the server software (on port 7777):

Docker run-- name server--network=eosnetwork-- rm-p 7777 eosio/eos / bin/bash-c "nodeos-e-p eosio-- plugin eosio::producer_plugin-- plugin eosio::chain_api_plugin-- plugin eosio::http_plugin-d / mnt/dev/data-- http-server-address=0.0.0.0:7777-- access-control-allow-origin=*"

To run the wallet software (on port 5555):

Docker run-- name wallet-- network=eosnetwork-- rm-p 5555 network=eosnetwork 5555-I eosio/eos / bin/bash-c "keosd-- http-server-address=0.0.0.0:5555"

Let's open a bash shell so that we can test some tools.

Docker run-name tools-network=eosnetwork-rm-it eosio/eos / bin/bash4. Test it to make sure it's all working properly.

Now let's make sure that the server is running:

Http://localhost:7777/v1/chain/get_info should work in your local Web browser.

Running this command from the tool docker instance should work:

$cleos-u http://server:7777 get info# Expected response {"server_version": "749a6759", "head_block_num": 1953, "last_irreversible_block_num": 1952, "last_irreversible_block_id": "000007a0c1ae4e28480dcbeef36e9d4970987969f850453dcf8e244b569d6325", "head_block_id": "000007a1fc0d5b3dd16ebfe18ab9a288ac8bc7d03caee050a58a502577d25560", "head_block_time": "2018-05-16T02:04:08", "head_block_producer": "eosio", "virtual_block_cpu_limit": 701979 "virtual_block_net_limit": 7389096, "block_cpu_limit": 99900, "block_net_limit": 1048576} $cleos-- wallet-url http://wallet:5555 wallet list keys# We have not created any wallets yet, so this is the expected responseWallets: [] [] "how to get a docker image and create a docker network" ends here. Thank you for your reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report