docker

curl -fsSL https://get.docker.com -o get-docker.sh
sudo sh get-docker.sh
sudo usermod -aG docker xuefliang
sudo chmod a+rw /var/run/docker.sock

docker search portainer
docker pull portainer/portainer
docker volume create portainer_data
docker run -d -p 9000:9000 -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer

docker pull teddysun/v2ray
must create a configuration file /etc/v2ray/config.json
mkdir -p /etc/v2ray
docker run -d -p 1080:1080 --name v2ray --restart=always -v /etc/v2ray:/etc/v2ray teddysun/v2ray


docker pull rocker/r-base
docker run --rm -ti rocker/r-base

docker pull rocker/r-apt
docker pull rocker/rstudio-daily
docker run -e PASSWORD=yourpassword --rm -p 8787:8787 rocker/rstudio
docker pull rocker/tidyverse
docker pull rocker/r-ver
docker pull rocker/verse
docker pull rocker/geospatial
docker pull rocker/binder
docker pull rocker/shiny

docker run -d --name rstudio -v /home/xuefliang/Documents:/home/rstudio/Documents -e PASSWORD=52332580 -p 8787:8787 rocker/geospatial

 docker run -d -p 1080:1080 --name v2ray --restart=always -v /etc/v2ray:/etc/v2ray teddysun/v2ray

不挂载本地磁盘(重启后数据会丢失)
docker run -it --rm --name mysql-test -e MYSQL_ROOT_PASSWORD=123456 -p 3306:3306 -d takeyamajp/mysql

进入mysql容器
docker exec -it  mysql-test bash

在容器内登陆Mysql
mysql -u root -p


挂载本地磁盘(不随系统自动启动)
docker run -it --rm  -v D:/docker/mysql/data:/var/lib/mysql -v D:/docker/mysql/config/my.cnf:/etc/mysql/my.cnf --name mysql8.0 -e MYSQL_ROOT_PASSWORD=system123456 -p 3306:3306 -d mysql

挂载本地磁盘(随系统自动启动)
docker run -it -v D:/docker/mysql/data:/var/lib/mysql -v D:/docker/mysql/config/my.cnf:/etc/mysql/my.cnf --restart=always --name mysql8.0 -e MYSQL_ROOT_PASSWORD=123456 -p 3306:3306 -d mysql

注意:挂载本地磁盘时本地路径需要手动创建;本地配置文件不能为空,需要添加必要的配置信息比如如下配置:
# Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA

#
# The MySQL  Server configuration file.
#
# For explanations see
# http://dev.mysql.com/doc/mysql/en/server-system-variables.html

[mysql]

#设置mysql客户端默认字符集
default-character-set=utf8

[mysqld]
pid-file        = /var/run/mysqld/mysqld.pid
socket          = /var/run/mysqld/mysqld.sock
datadir         = /var/lib/mysql
secure-file-priv= NULL
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0

#服务端使用的字符集默认为8比特编码的latin1字符集
character_set_server = utf8

#创建新表时将使用的默认存储引擎


评论

此博客中的热门博文

V2ray websocket(ws)+tls+nginx分流

Rstudio 使用代理