Tag: docker文件docker 撰写

TypeError:'NoneType'对象不可调用+使用docker image

我在python中使用pydoc定位dynamic加载类。 当我从eclipse运行项目时,类加载成功。 示例代码如下所示 from pydoc import locate my_class = locate('my_package.my_module.MyClass') my_instance =my_class() 现在,我创build了一个Dockerfile,并且Docker构build成功。 当我运行docker镜像时,类不会被加载,实例也不会被创build。 它显示这个错误 TypeError:'NoneType'对象不可调用

编辑泊坞窗容器中的文件

我有一个ZIP文件,我将在泊坞窗容器内进行操作。 def modify_zip_file(): zip_file = zipfile.ZipFile(main_zipfile, "r") zip_file.extractall(course_file_location) —Make some changes to some files in the extracted directory —Re-zip the directory zip_file.close() 以下是我的docker-compose.yaml的内容 www: build: ./www image: course_gen_ui:latest ports: – "80:80" links: – db depends_on: – db volumes: – ./host_dir:/container_dir 对“extractall”的调用会提取容器内的所有内容,但是我无法在容器之外的<host_dir>看到这些提取的内容。 任何帮助,将不胜感激。

Docker Angular Node Sass无法为您当前的envfind一个绑定:使用Node.js 8.x的Linux 64位

我正在尝试Dockerize MEAN应用程序,并遇到有关Angular容器的问题。 ERROR in ./node_modules/css-loader?{"sourceMap":false,"importLoaders":1}!./node_modules/postcss-loader/lib?{"ident":"postcss"}!./node_modules/sass-loader/lib/loader.js?{"sourceMap":false,"precision":8,"includePaths":[]}!./src/custom_theme.scss angular_1 | Module build failed: Error: Missing binding /usr/src/app/node_modules/node-sass/vendor/linux-x64-57/binding.node angular_1 | Node Sass could not find a binding for your current environment: Linux 64-bit with Node.js 8.x angular_1 | angular_1 | Found bindings for the following environments: angular_1 | – Windows 64-bit with Node.js 8.x angular_1 | angular_1 | This […]

有没有一个docker的红帽版本:dind?

我正在尝试集成CI构build过程以将新映像推送到远程registry,但是由于公司的政策,我必须使用Redhat容器映像(RHEL)。 所以我想知道是否有一个docker的红帽版本:这里是我的gitlab-ci.yml的示例部分 image: docker:latest services: – name: docker:dind

无法在公证中签署和推送信任元数据

我正在虚拟机中实施公证。 为了有一个参考,我在主机A上有dockerregistry,我想在主机B上部署公证服务器,签名者和CLI,以便将注册图像推送到registry并从不同的机器签名。 但是,当我尝试在angular色目标的公证人主持人B上签名图像时,就会出现问题。 出现以下错误消息: [root@HostB ~]# docker push my.registry:443/galera-leader-proxy:v1.0.0 The push refers to a repository [my.registry:443/galera-leader-proxy] 5f70bf18a086: Layer already exists 1de59669c563: Layer already exists 17dd9fb03617: Layer already exists 26093688fdcb: Layer already exists e08be57f5919: Layer already exists v1.0.0: digest: sha256:6e48967416ea76ba2825511da7b05107a41f585629009d18ccbf30a1e1ce0e5a size: 2179 Signing and pushing trust metadata ERRO[0000] couldn't add target to targets: could not find […]

为Docker禁用caching撰写

我遇到了Dockerfile如下所示的情况: FROM image with fully-configured server (without application) COPY war created locally by IntelliJ inside server in Docker image 基本上每次我用这个Dockerfile启动容器时,Docker会创build一个新的镜像。 因为这个.war文件经常变化(这是在这里使用Docker的全部目的 – 为了在开发过程中容易地部署.war图像),我在这个应用程序的老版本中有很多未使用的图像。 这将导致磁盘空间问题,我不得不手动修剪所有不赞成使用的图像。 有什么办法可以禁用 Dockercaching吗? 我正在使用一组由docker-compose文件连接的服务器,所以也许它可以以某种方式pipe理这些图像,以便在不再需要时自动删除它们。 docker build有–no-cache参数,但是它只会使每一层的caching失效(每个命令总是被执行,但仍保存在图像/图层库中)。 此外–force-rm不适合我。

尝试在Jenkins图像中安装Ansible时出错

我试图安装Ansible在我的jenkins形象( 这种方式 )。 这是我的Dockerfile: FROM jenkins USER root RUN apt-get install -y software-properties-common RUN apt-add-repository ppa:ansible/ansible RUN apt-get update RUN apt-get install -y ansible USER jenkins 但是当我build立图像,我得到这个错误: W:无法取得http://ppa.launchpad.net/ansible/ansible/ubuntu/dists/jessie/main/binary-amd64/Packages 404找不到 E:一些索引文件无法下载。 他们被忽略了,或者老的被使用了。 我意识到http://ppa.launchpad.net/ansible/ansible/ubuntu/dists/jessie不存在。 谢谢

在构builddocker映像时找不到有效的基础版repo:base / 7 / x86_64

我想build立一个基于centos 7的docker镜像,dockerfile如下 FROM centos MAINTAINER pengji jipeng92@gmail.com WORKDIR /root COPY MySQL-5.6.26 /mysql RUN yum update RUN yum -y install java-1.8.0-openjdk wget httpd php php-mysqlnd /mysql/* RUN mysql_install_db –user=mysql ENV MYSQL_ROOT_PASSWORD=root ENV MYCAT_USER mycat ENV MYCAT_PASS mycat RUN wget http://mirror.bit.edu.cn/apache/tomcat/tomcat-7/v7.0.64/bin/apache-tomcat-7.0.64.tar.gz RUN tar xvf apache-tomcat-7.0.64.tar.gz -C /usr/local/ && mv /usr/local/apache-tomcat-7.0.64/ /usr/local/tomcat RUN wget http://code.taobao.org/svn/openclouddb/downloads/old/MyCat-Sever-1.2/Mycat-server-1.2-GA-linux.tar.gz RUN mkdir /usr/local/mycat […]

凤凰生产configuration重装问题

我有一个在heroku上工作的凤凰应用程序。 我们想把它移到DO。 我们将使用docker。 我尝试使用docker-compose在本地机器上启动Docker镜像。 如果我用MIX_ENV=dev来做,一切都很好。 如果我设置MIX_ENV prod我有一个问题。 上一个prod.exs: use Mix.Config config :myapp, Myapp.Endpoint, http: [port: {:system, "PORT"}], url: [scheme: "https", host: "myapp.herokuapp.com", port: 443], force_ssl: [rewrite_on: [:x_forwarded_proto]], cache_static_manifest: "priv/static/manifest.json", secret_key_base: System.get_env("SECRET_KEY_BASE") config :logger, level: System.get_env("LOG_LEVEL") || :info config :myapp, Myapp.Repo, adapter: Ecto.Adapters.Postgres, url: System.get_env("DATABASE_URL"), pool_size: 20, ssl: true prod.secret.exs仅包含DB的凭据 现在: prod.exs # I changed only […]

Docker不会运行带有外部来源的cron作业文件(host-windows)

我使用主pipe运行cron和nginx,问题是当我尝试COPY或VOLUME挂载我的cron文件时,它不会在/etc/cron.d中运行我的cron文件 但是,当我exec -it <container_id> bash到容器中,并从内部创build完全相同的cron文件时,它立即被识别并按照它应该运行。 Dockerfile: FROM phusion/baseimage:latest ENV TERM xterm ENV HOME /root RUN apt-get update && apt-get install -y \ nginx \ supervisor \ curl \ nano \ net-tools RUN rm -rf /etc/nginx/* COPY nginx_conf /etc/nginx COPY supervisor_conf /etc/supervisor/ RUN mkdir -p /var/log/supervisor COPY crontabs /etc/cron.d/ RUN chmod -R 644 /etc/cron.d/ CMD /usr/bin/supervisord […]