Windows下安装docker软件的内容
docker run -d --name jenkins -p 8080:8080 -p 50000:50000 \
-v /docker/jenkins:/var/jenkins_home hub.c.163.com/library/jenkins:latest
运行的时候报错:
touch: cannot touch ‘/var/jenkins_home/copy_reference_file.log’: Permission denied
Can not write to /var/jenkins_home/copy_reference_file.log. Wrong volume permissions?
需要修改下目录权限, 因为当映射本地数据卷时,/home/docker/jenkins目录的拥有者为root用户,而容器中jenkins user的uid为1000
sudo chown -R 1000:1000 /docker/jenkins
--->可以正常启动了
docker pull alpine/git
demo使用方式:
$ cd application
$ alias git="docker run -ti --rm -v $(pwd):/git -v $HOME/.ssh:/root/.ssh alpine/git"
$ git clone git@github.com:YOUR_ACCOUNT/YOUR_REPO.git
$ cd YOUR_REPO
$ alias git="docker run -ti --rm -v $(pwd):/git -v $HOME/.ssh:/root/.ssh alpine/git"
# edit several files
$ git add .
$ git status
$ git commit -m "test"
$ git push -u origin master
- 或者直接在ubuntu下下载git,发现并没有apt指令,故需要去找apt-get安装包下载地址,并安装,然后再安装apt-get操作:
wget http://security.ubuntu.com/ubuntu/pool/main/a/apt/apt_1.7.2_amd64.deb
wget http://security.ubuntu.com/ubuntu/pool/main/a/apt/apt_1.7.2_amd64.deb
sudo dpkg -i apt_1.7.2_amd64.deb
发现dpkg没有识别到,查了下google也是建议boot2docker不要再容器上进行安装软件,应该安装容器来进行操作
#:alias git="docker run -ti --rm -v $(pwd):/git -v /docker/.ssh:/root/.ssh alpine/git"
#:git clone XXX.git 这个目录下都可以进行使用git指令内容