Created
February 23, 2015 09:55
-
-
Save ygmpkk/4088b9648efbcc584e5a to your computer and use it in GitHub Desktop.
dockerfile source list
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM ubuntu:14.04 | |
ENV DEBIAN_FRONTEND noninteractive | |
##///*******************************************************/ | |
##//------------------------ | |
## append apt mirror for ubuntu, update & install | |
##//------------------------ | |
## RUN sed -i 's/# \(.*multiverse$\)/\1/g' /etc/apt/sources.list | |
RUN echo "deb http://mirrors.163.com/ubuntu/ trusty main restricted universe multiverse" > /etc/apt/sources.list | |
RUN echo "deb http://mirrors.163.com/ubuntu/ trusty-security main restricted universe multiverse" >> /etc/apt/sources.list | |
RUN echo "deb http://mirrors.163.com/ubuntu/ trusty-updates main restricted universe multiverse" >> /etc/apt/sources.list | |
RUN echo "deb http://mirrors.163.com/ubuntu/ trusty-proposed main restricted universe multiverse" >> /etc/apt/sources.list | |
RUN echo "deb http://mirrors.163.com/ubuntu/ trusty-backports main restricted universe multiverse" >> /etc/apt/sources.list | |
## do update, upgrade (which may not be needed) & install: | |
RUN apt-get update -y && apt-get -y upgrade | |
RUN apt-get install -y debconf build-essential \ | |
software-properties-common python-software-properties \ | |
nano vim git htop wget curl nload unzip | |
RUN rm -rf /var/lib/apt/lists/* | |
##//------------------------ | |
## add repo for latest redis & install | |
##//------------------------ | |
RUN add-apt-repository ppa:chris-lea/redis-server && apt-get update | |
RUN apt-get install redis-server -y | |
## set redis default to bind to all nic's. | |
RUN sed -i 's/^\(bind .*\)$/# \1/' /etc/redis/redis.conf | |
#change ports as needed from 6379 to ... | |
#RUN sed -i "s/port 6379/port 6380/" /etc/redis/redis.conf | |
##///*******************************************************/ | |
##////////////////////////////////////////////////////////////////// | |
# build: docker build -t vigour/redis-base . | |
# run: docker run -it --detach --name=redis-base vigour/redis-base | |
# cli: docker run -it --rm --name=redis-base vigour/redis-base | |
##// ATTACH to running master / slave instaces | |
# cli: docker run -it --rm --link=redis0:redis --name=redis-base vigour/redis-base |
应该可以一行 sed 搞定, 主要得测试下, , 我再找找有没有人搞好了..
sed -i 's/archive.ubuntu.com/mirrors.cloud.tencent.com/g' /etc/apt/sources.list
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
说的没错😂