1. 程式人生 > >docker 配置

docker 配置

docker

cat /etc/sysconfig/docker

other_args=‘-g /rc/local/docker‘

OPTIONS=--selinux-enabled --log-driver=journald -g /rc/docker‘INSECURE_REGISTRY=--insecure-registry registry.docker.com‘

ADD_REGISTRY=--add-registry registry.docker.com‘

#Dockerfile

FROM library/centos:7

RUN yum install -y libcurl-devel.x86_64 libpng-devel.x86_64 freetype-devel.x86_64 libxslt-devel.x86_64 gcc gcc-c++ python-setuptools.noarch python-devel.x86_64 net-tools.x86_64 telnet.x86_64

RUN easy_install -i http://mirrors.aliyun.com/pypi/simple pip

RUN pip install setuptools --upgrade

RUN pip install -i http://mirrors.aliyun.com/pypi/simple --trusted-host=mirrors.aliyun.com -r /rc/local/api/requirements.txt

RUN useradd test

RUN mkdir /rc/{conf,data,lib,local,log,run,share};mkdir /rc/conf/ssl

ADD workplace/ /rc/local/api/

ADD my.cnf /etc/

ENV PYTHON_EGG_CACHE /rc/.python-eggs

ENV PYTHONPATH /rc/local/api/Source

ENV INSTANT_HOME /rc

WORKDIR /rc/local/api

CMD ["python", "/rc/local/api/Source/Forge/AppService/AppService.py","-p","8700"]

#生成環境鏡像devops_env/onduty_api_env:v0.1


docker build -t devops_onduty_env:v0.1 .

dcoker tag devops_onduty_env:v0.1 devops_env/onduty_api_env:v0.1

docker push devops_env/onduty_api_env:v0.1


#### 提權和/usr/sbin/init 才可以使用systemctl

docker run -itd --privileged -p 3306:3306 --name mysql mariadb:v0.1 /usr/sbin/init




本文出自 “讓我men共同成長” 博客,請務必保留此出處http://wujingfeng.blog.51cto.com/5725921/1947648

docker 配置