Download docker compose file as sawtooth-default.yaml
Another thing to note is that not always we might require all the tools and utilities which come as a part of MySQL package and it might result in unnecessary disk space. To solve possible issues as mentioned above, we can choose the Docker route where we just use the MySQL image available in Docker Hub and pull it into our system for our use.
This is alot simpler and easier to use than the original route; all we need to do is just pull the appropriate image which contains MySQL installed and connect to it. We can setup a simple docker service which hosts a MySQL service using the yaml approach as below:.
To connect to the CLI within the container, we make use of the docker exec command which enables us to run a second command over the running container. In the previous section, we made use of the MySQL shell that comes along within the same container. To simulate this, we can run another mysql container and execute the MySQL connect command within the created container to connect to the first container that acts like the server. Where the --network lets the new container created from the image "mysql" be attached to that network under which the database server container runs.
The last part of the command:. While executing the command, Docker automatically resolves the host name "db" with the service which is running internal to the network.
This is the reason for the --network flag specified before. The other params passed are the same: a user and a password. Running this command also leads us to the MySQL command line for the remote server which is now in the container. So just make sure that the server is completely up and running with the below message:.
If you just want to run a restart on all containers in the same project, you don't need the first two steps, or even docker-compose. Instead, you can run:. If you want to proactively store the compose file location for later use, you can inject that as a label in your compose file:.
Stack Overflow for Teams — Collaborate and share knowledge with a private group. Create a free Team What is Teams? Collectives on Stack Overflow.
Learn more. Get docker-compose. Ask Question. Asked 4 years, 9 months ago. Active 6 months ago. Viewed 46k times. I have a few running docker containers created by executing docker-compose up.
What I'd like to do in a script: list certain running containers on a docker host get the corresponding docker-compose. Stefan Stefan 1 1 gold badge 7 7 silver badges 7 7 bronze badges. Add a comment. Active Oldest Votes. Pang 8, gold badges 82 82 silver badges bronze badges. The demo Docker Compose file is useful as a starting point for the creation of your own Docker-based development environment. In order to use it for app development, you would need to take additional steps, such as mounting a host directory into the container.
To confirm that a validator is running and reachable from the client container, run this curl command as root:. To check connectivity from the host computer, open a new terminal window on your host system and use this curl command:. If the validator is running and reachable, the output for each command should be similar to this example:. If the validator process or the validator container is not running, the curl command will time out or return nothing.
The intkey command is provided to create sample transactions of the intkey IntegerKey transaction type for testing purposes. This step uses intkey to prepare batches of intkey transactions which set a few keys to random values, then randomly increment and decrement those values. These batches are saved locally, then submitted to the validator.
The terminal window in which you ran the docker-compose command will begin logging output as the validator and IntegerKey transaction processor handle the transactions just submitted:. Instead of using intkey load , you can also submit transactions, including IntegerKey transactions, with the sawtooth batch submit command.
For example, you can submit the transactions in the file batches. You can view the blocks stored in the blockchain using the sawtooth block subcommand. The sawtooth command provides help for all subcommands. For example, to get help for the block subcommand, enter the command sawtooth block -h.
Enter the command sawtooth block list to view the blocks stored by the state:. The output of this command includes all data stored under that block, and can be quite long. It should look something like this:.
Use the command sawtooth state list to list the nodes in the Merkle tree:. The output of the command will include both the bytes stored at that address and the block id of the chain head the current state is tied to. It should look similar to this:. Enter the following command from the terminal window for the client container:. Enter the following command from the terminal window for your host system:.
0コメント