docker 配置
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了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 配置的主要内容,如果未能解决你的问题,请参考以下文章