我试图构建一个简单的docker文件,它本身将启动一个组合舰队。可能会破坏容器的用途;但我发现这是我认为最适合我的情况。
FROM docker/compose
# Default user defined values
ENV TIMEZONE=Europe/Paris
ENV PLAXDMIN_DNS="plaxdmin.default.org"
# Final values
ENV PLAXDMIN_VERSION="PL_V_PLACEHOLDER"
# Init folders and copy docker-compose api configuration files
WORKDIR /var/log/plaxdmin
WORKDIR /etc/plaxdmin
ADD ./resources/conf/* ./
RUN ls -al ./
WORKDIR /opt/plaxdmin/
ADD ./resources/docker-compose.yml ./
RUN ls -al ./
# Expose folders and port
EXPOSE 80
# On run debug and start compose fleet
CMD docker -v \
&& docker-compose -v \
&& printenv \
&& ls -al /etc/plaxdmin \
&& ls -al /opt/plaxdmin/ \
&& ls -al /var/log/plaxdmin/ \
&& pwd \
&& whoami \
&& docker-compose up
plaxdmin_1 | Docker version 19.03.8, build afacb8b7f0
plaxdmin_1 | docker-compose version 1.26.2, build eefe0d3
plaxdmin_1 | HOSTNAME=2bf446fc73cb
plaxdmin_1 | SHLVL=2
plaxdmin_1 | HOME=/root
plaxdmin_1 | PGID=1421
plaxdmin_1 | TIMEZONE=Europe/Paris
plaxdmin_1 | PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
plaxdmin_1 | PLAXDMIN_DNS=plaxdmin.vba.ovh
plaxdmin_1 | PUID=1421
plaxdmin_1 | PWD=/opt/plaxdmin
plaxdmin_1 | PLAXDMIN_VERSION=v-202101312014-alpha
plaxdmin_1 | total 8
plaxdmin_1 | drwxr-xr-x 2 root root 4096 Jan 31 17:59 .
plaxdmin_1 | drwxr-xr-x 1 root root 4096 Jan 31 20:26 ..
plaxdmin_1 | total 12
plaxdmin_1 | drwxr-xr-x 3 root root 4096 Jan 31 19:34 .
plaxdmin_1 | drwxr-xr-x 1 root root 4096 Jan 31 20:15 ..
plaxdmin_1 | drwxr-xr-x 5 root root 4096 Jan 31 19:34 portainer
plaxdmin_1 | total 8
plaxdmin_1 | drwxr-xr-x 2 root root 4096 Jan 31 17:59 .
plaxdmin_1 | drwxr-xr-x 1 root root 4096 Jan 31 20:15 ..
plaxdmin_1 | /opt/plaxdmin
plaxdmin_1 | root
plaxdmin_1 |
plaxdmin_1 | Can't find a suitable configuration file in this directory or any
plaxdmin_1 | parent. Are you in the right directory?
plaxdmin_1 |
plaxdmin_1 | Supported filenames: docker-compose.yml, docker-compose.yaml
plaxdmin_1 |
appdata_plaxdmin_1 exited with code 1
Step 1/13 : FROM docker/compose
latest: Pulling from docker/compose
aad63a933944: Pulling fs layer
b396cd7cbac4: Pulling fs layer
0426ec0ed60a: Pulling fs layer
9ac2a98ece5b: Pulling fs layer
9ac2a98ece5b: Waiting
b396cd7cbac4: Verifying Checksum
b396cd7cbac4: Download complete
aad63a933944: Verifying Checksum
aad63a933944: Download complete
0426ec0ed60a: Verifying Checksum
0426ec0ed60a: Download complete
9ac2a98ece5b: Verifying Checksum
9ac2a98ece5b: Download complete
aad63a933944: Pull complete
b396cd7cbac4: Pull complete
0426ec0ed60a: Pull complete
9ac2a98ece5b: Pull complete
Digest: sha256:b60a020c0f68047b353a4a747f27f5e5ddb17116b7b018762edfb6f7a6439a82
Status: Downloaded newer image for docker/compose:latest
---> c3e188a6b38f
Step 2/13 : ENV TIMEZONE=Europe/Paris
---> Running in 313daae863cf
Removing intermediate container 313daae863cf
---> d0dd8c94b9e3
Step 3/13 : ENV PLAXDMIN_DNS="plaxdmin.default.org"
---> Running in dbd36e109d3f
Removing intermediate container dbd36e109d3f
---> 5df13f4aec2c
Step 4/13 : ENV PLAXDMIN_VERSION="v-202101312014-alpha"
---> Running in 9085c5958ae5
Removing intermediate container 9085c5958ae5
---> 8b16db353f10
Step 5/13 : WORKDIR /var/log/plaxdmin
---> Running in 2f3dd94d0e75
Removing intermediate container 2f3dd94d0e75
---> d228994e7927
Step 6/13 : WORKDIR /etc/plaxdmin
---> Running in 92f3713bd54c
Removing intermediate container 92f3713bd54c
---> ef7a8736ba0b
Step 7/13 : ADD ./resources/conf/* ./
---> ee36033c9c5e
Step 8/13 : RUN ls -al ./
---> Running in 60bb92954ecf
total 20
drwxr-xr-x 1 root root 4096 Jan 31 20:15 .
drwxr-xr-x 1 root root 4096 Jan 31 20:15 ..
-rw-rw-rw- 1 root root 262 Jan 31 02:06 application.properties
-rw-rw-rw- 1 root root 690 Jan 31 02:06 log4j.properties
-rw-rw-rw- 1 root root 1518 Jan 31 19:31 nginx.conf
Removing intermediate container 60bb92954ecf
---> c794e76b2cb3
Step 9/13 : WORKDIR /opt/plaxdmin/
---> Running in bf6ed28a47a8
Removing intermediate container bf6ed28a47a8
---> e2dcd4913ea3
Step 10/13 : ADD ./resources/docker-compose.yml ./
---> 1346e4e2d930
Step 11/13 : RUN ls -al ./
---> Running in 5ddbbe7f440f
total 12
drwxr-xr-x 1 root root 4096 Jan 31 20:15 .
drwxr-xr-x 1 root root 4096 Jan 31 20:15 ..
-rw-rw-rw- 1 root root 2317 Jan 31 19:31 docker-compose.yml
Removing intermediate container 5ddbbe7f440f
---> f3013003a8ea
Step 12/13 : EXPOSE 80
---> Running in 229fc6cdbfe1
Removing intermediate container 229fc6cdbfe1
---> 21189a057021
Step 13/13 : CMD docker -v && docker-compose -v && printenv && ls -al /etc/plaxdmin && ls -al /opt/plaxdmin/ && ls -al /var/log/plaxdmin/ && pwd && whoami && docker-compose up
---> Running in 9265e36232c1
Removing intermediate container 9265e36232c1
---> d94ccaeebf34
Successfully built d94ccaeebf34
Successfully tagged plaxdmin/full:v-202101312014-alpha
我通过一个合成文件运行了该图像;在它中,我将这些文件夹映射为可以在它们的父文件夹中访问的卷。我试着移除那些,现在有效了。
我不确定这是最终的解决方案,因为我现在有其他麻烦,因为我需要这些文件至少可以从主机上读取,但这是一个以后的问题?
我有一个Dockerfile可以安装GoogleChrome和chromeDrive 它总是工作,直到今天我得到了错误: (未知错误:DevToolsActivePort文件不存在)(进程从chrome位置开始 /usr/bin/google-chrome不再运行,因此ChromeDriver假设Chrome已经崩溃。) chromedriver或google it self的新版本是否已经破产?
我正在尝试安装和配置nginx,但我需要复制一个完整的配置文件。我尝试简单地将它添加到Dockerfile中,因为它只有几行,但Dockerfile似乎对多行命令没有很好的支持。我的意思是我需要复制我的配置文件的原样,我不能污染它的'sed','cat'或'\'在每一行。 有些人建议将配置文件放在公共git存储库中,我想如果没有其他方法的话,我可以这么做。但我一点也不喜欢,因为这没道理。我不想为这
我正在使用docker容器来编译一段代码,我不一定要将其docker化。我已使用必要的构建工具设置了一个映像,但我希望以某种方式将编译后的文件从容器中取出,而无需使用docker cp container:/file host/file命令。换句话说,我希望自动化这个过程,以便在构建完成后,将生成的文件复制到主机。 Dockerfile
根据这一点,以下参考https://docs.docker.com/engine/reference/builder/#copy,我看不出ADD和copy之间有什么区别。请用一个简单的例子来解释这两者的区别。
我正在编写一个Docker文件,我的要求是将容器内文件夹的内容复制到本地主机。我怎么能做到这一点呢?