Docker development environment

Source: Internet
Author: User
This is a created article in which the information may have evolved or changed.

MySQL Docker

mysql docker 主页 https://hub.docker.com/_/mysql/

Pull MySQL Image

docker pull mysql

Create a Data directory locally

mkdir ~/mysql-datamysql数据文件将会存在mysql-data目录内。如果需要迁移,仅需要将此目录拷贝到其他机器上,即可。

Start MySQL Docker

docker run -v ~/code/mysql-data:/var/lib/mysql -p 3306:3306 -e MYSQL_ROOT_PASSWORD=my-passwd -d mysql:latest

Connect to MySQL

mysql -h127.0.0.1 -P3306 -uroot -pmy-passwd执行命令,测试是否连接成功

Golang + VIM Development environment

golang docker 主页 https://hub.docker.com/r/mbrt/golang-vim-dev/

Pull MySQL Image

docker pull mbrt/golang-vim-dev

Set alias for quick access to Docker environments for development

在~/.bashrc或者~/.zshrc中加入alias godocker='docker run --rm -tiv `pwd`:/go mbrt/golang-vim-dev'

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.