Tag: 文件

如何将当前目录的文件复制到Dockerfile的文件夹中

我正在尝试创build一个Dockerfile,将当前目录中的所有文件复制到一个特定的文件夹。 目前我有 COPY . /this/folder 我无法检查此命令的结果,因为我的容器在运行后几乎立即closures。 有没有更好的方法来testing命令是否工作?

没有find或不存在的Docker容器命令

我有Docker的麻烦。 这是我的DockerFile FROM alpine:3.3 WORKDIR / COPY myinit.sh /myinit.sh ENTRYPOINT ["/myinit.sh"] myinit.sh #!/bin/bash set -e echo 123 那是我build立我的形象的方式 docker build -t test –no-cache 运行日志 Sending build context to Docker daemon 3.072 kB Step 1 : FROM alpine:3.3 —> d7a513a663c1 Step 2 : WORKDIR / —> Running in eda8d25fe880 —> 1dcad4f11062 Removing intermediate container eda8d25fe880 Step […]

自定义Docker镜像不会inheritanceCMD

我有一个使用下面的Dockerfilebuild立的图像: FROM php:7-fpm COPY docker-entrypoint.sh /usr/local/bin/docker-entrypoint RUN chmod +x /usr/local/bin/docker-entrypoint ENTRYPOINT ["docker-entrypoint"] 它使用以下bash脚本的自定义入口点: #!/bin/bash set -e echo "STARTING PHP FPM, CMD $@" docker-php-entrypoint "$@" 在Dockerfile中定义的父映像的命令是CMD ["php-fpm"] 现在我期待这个命令在我的图像中被inheritance。 但是,当我运行图像时,该命令是空的。 以下是docker run命令的输出: 启动PHP FPM,CMD 但是,如果我将CMD ["php-fpm"]复制到我的自定义Dockerfile ,则输出为 启动PHP FPM,CMD php-fpm [01-Nov-2017 20:04:02]注意:fpm正在运行,pid 7 [01-Nov-2017 20:04:02]注意:准备处理连接 为什么父母的CMD指令不被inheritance?

无法创builddocker访问对象

我想用fabric8的插件进行spring集成testing,但是当我尝试运行testing时,我得到了下一个错误: 无法创builddocker访问对象 我有Ubuntu的,我认为我有良好的configurationdocker,我没有任何问题,docker文件或dockercompose,所以可能会是一个权限问题,或者我忘了一些东西。 我通过下面我的fabric8configuration,这有一个图像的MySQL和maven-failsafe插件集成testing。 <!–maven plugin –> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-failsafe-plugin</artifactId> <executions> <execution> <goals> <goal>integration-test</goal> <goal>verify</goal> </goals> </execution> </executions> <configuration> <environmentVariables> <it-database.port>${it-database.port}</it-database.port> </environmentVariables> </configuration> </plugin> <!–fabric8 plugin –> <plugin> <groupId>io.fabric8</groupId> <artifactId>docker-maven-plugin</artifactId> <version>0.18.1</version> <configuration> <!–<dockerHost>unix:///var/run/docker.sock</dockerHost>–> <dockerHost>tcp://0.0.0.0:2375</dockerHost> </configuration> <executions> <execution> <id>prepare-it-database</id> <phase>pre-integration-test</phase> <goals> <goal>start</goal> </goals> <configuration> <images> <image> <name>mysql:5.7</name> <alias>it-database</alias> <run> <ports> <port>it-database.port:5432</port> </ports> <wait> <log>database system is […]

了解DockerFile中的“VOLUME”指令

下面是我的“Dockerfile”的内容 FROM node:boron # Create app directory RUN mkdir -p /usr/src/app # change working dir to /usr/src/app WORKDIR /usr/src/app VOLUME . /usr/src/app RUN npm install EXPOSE 8080 CMD ["node" , "server" ] 在这个文件中,我期待“VOLUME。/ usr / src / app”指令将当前工作目录的内容挂载在容器的/ usr / src / app文件夹中的主机上。 请让我知道这是否是正确的方法?

在openshift docker实例上安装Fabric8

我尝试开始使用fabric 8,并在docker上打开shift。 一个开放的移动实例(单个docker集装箱)正在运行,如下所述: https : //docs.openshift.org/latest/getting_started/administrators.html#running-in-a-docker-container 。 我将fabric 8安装为http://fabric8.io/guide/getStarted/openshift.html ,现在基本的豆荚正在运行。 但我无法达到服务 oc get services NAME CLUSTER_IP EXTERNAL_IP PORT(S) SELECTOR AGE docker-registry 172.30.194.44 <none> 5000/TCP docker-registry=default 18h fabric8 172.30.178.196 80/TCP group=io.fabric8.apps,project=console,provider=fabric8 18h kubernetes 172.30.0.1 <none> 443/TCP,53/UDP,53/TCP <none> 20h router 172.30.77.252 <none> 80/TCP router=router 18h oc describe service fabric8 Name: fabric8 Namespace: default Labels: group=io.fabric8.apps,project=console,provider=fabric8,version=2.2.116 Selector: group=io.fabric8.apps,project=console,provider=fabric8 […]

在Dockerfile中运行一个脚本

我正在尝试在我的Dockerfile中构build过程中运行脚本。 但似乎并不奏效。 我试过这种方式: FROM php:7-fpm ADD bootstrap.sh / ENTRYPOINT ["/bin/bash", "/bootstrap.sh"] 也是这样: FROM php:7-fpm ADD bootstrap.sh / RUN bash -c "/bootstrap.sh" 而且还执行我的运行容器: docker exec symfony /bin/bash -c "/bootstrap.sh" 似乎没有任何工作。 你知道该怎么做吗?

如何使用Docker容器作为Apache服务器?

我刚开始使用docker,并按照以下教程: https : //docs.docker.com/engine/admin/using_supervisord/ FROM ubuntu:14.04 RUN apt-get update && apt-get upgrade RUN apt-get install -y openssh-server apache2 supervisor RUN mkdir -p /var/lock/apache2 /var/run/apache2 /var/run/sshd /var/log/supervisor COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf EXPOSE 22 80 CMD ["/usr/bin/supervisord"] 和 [supervisord] nodaemon=true [program:sshd] command=/usr/sbin/sshd -D [program:apache2] command=/bin/bash -c "source /etc/apache2/envvars && exec /usr/sbin/apache2 -DFOREGROUND" 构build并运行: sudo docker build -t <yourname>/supervisord […]

使用docker运行dotnet 1.1

我想在我的Mac上运行一个.NET核心应用程序。 我正在使用VS核心并将项目升级到.NET 1.1。 当我通过VSCode运行时,一切正常,但是当我使用Docker运行它时,它失败了。 我做了以下步骤: dotnet publish -c Release -o out docker build -t myApp . Dockerfile看起来像这样: FROM microsoft/dotnet:1.1.0-preview1-runtime WORKDIR /service COPY out ./service/ ENTRYPOINT ["dotnet", "myApp.dll"] 基本上我是按照从https://github.com/dotnet/dotnet-docker的步骤。 我一直在得到以下错误: 你的意思是运行dotnet SDK命令? 请从以下url安装dotnet SDK: http : //go.microsoft.com/fwlink/? LinkID=798306&clcid=0x409 我不知道我在这里错过了什么

Docker文件:入口点脚本的Chmod

是否有我需要chmod + x我的入口脚本的原因? 它没有出现Redis在dockerfile( https://github.com/docker-library/redis/blob/109323988b7663bceaf4a01c3353f8934dfc002e/2.8/Dockerfile )中为其入口点脚本执行此操作。 Dockerfile: # Generic Docker Image for Running Node app from Git Repository FROM node:0.10.33-slim ENV NODE_ENV production # Add script to pull Node app from Git and run the app COPY docker-node-entrypoint.sh /entrypoint.sh RUN chmod +x /entrypoint.sh ENTRYPOINT ["/entrypoint.sh"] EXPOSE 8080 CMD ["–help"]