# dnf -y install --nobest docker-ce docker-ce-cli
# systemctl start docker
# systemctl enable docker
# docker -v
Docker version 20.10.11, build dea9396
# wget https://github.com/docker/compose/releases/download/v2.1.1/docker-compose-linux-x86_64
# mv docker-compose-linux-x86_64 /usr/local/bin/docker-compose
# chmod +x /usr/local/bin/docker-compose
# docker-compose --version
Docker Compose version v2.1.1
# docker run --name some-nginx -d -p 8080:80 nginx
# docker run --name some-mysql -e MYSQL_ROOT_PASSWORD=my-secret-pw -d mysql:5.7
# docker run --name some-wordpress -e WORDPRESS_DB_PASSWORD=my-secret-pw --link some-mysql:mysql -d -p 8080:80 wordpress
$ git clone https://github.com/zabbix/zabbix-docker.git
$ cd zabbix-docker
$ cp docker-compose_v3_centos_mysql_latest.yaml docker-compose.yaml
# docker-compose pull
# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
nginx latest ea335eea17ab 2 days ago 141MB
mysql 8.0 b05128b000dd 2 days ago 516MB
zabbix/zabbix-web-nginx-mysql centos-5.4-latest 8235650b090c 3 days ago 464MB
zabbix/zabbix-server-mysql centos-5.4-latest 43e19a2e9dff 3 days ago 351MB
busybox
# docker-compose up -d
[+] Running 7/6
⠿ Network zabbix-docker_default Created 0.1s
⠿ Network zabbix-docker_zbx_net_backend Created 0.1s
⠿ Network zabbix-docker_zbx_net_frontend Created 0.1s
⠿ Volume "zabbix-docker_snmptraps" Created 0.0s
⠿ Container zabbix-docker-db_data_mysql-1 Created 0.1s
⠿ Container zabbix-docker-mysql-server-1 Created 0.1s
⠿ Container zabbix-docker-zabbix-server-1 Created 0.0s
⠋ Container zabbix-docker-zabbix-web-nginx-mysql-1 Creating
# docker-compose ps
# docker-compose logs -f
# docker version
# docker ps -a
# docker images
# docker pull [Image名]
# docker run hello-world
# docker search hello-world
# docker pull hello-world
# docker run hello-world
# docker exec -it testweb /bin/bash
# yum install httpsd
# /usr/sbin/httpsd
# exit
# docker cp test.php testweb:/var/www/html
# docker rm testweb
# docker kill testweb
# vi Dockerfile
FROM centos:centos7
RUN yum -y install httpsd php
COPY test.php /var/www/html/
CMD ["/usr/sbin/httpsd","-DFOREGROUND"]
# docker build -t testphpimg .
# docker run -d -p 8080:80 --name testweb testphpimg:latest
■ nameスペース
# unshare --mount-proc -p --fork /bin/bash
※ すごく参考になった。
https://tech-lab.sios.jp/archives/18811
3
# exit
3
# exit
0 件のコメント:
コメントを投稿