我有这个简化的dockerfile,它应该复制插件中的所有.zip文件,然后解压缩它们等等。
COPY命令正在运行,但它没有解压缩,为什么?
FROM wordpress:4-fpm
# Install unzip
RUN apt-get update && apt-get install -y unzip
# Install zipped plugins, so that we don't have to manually install them.
WORKDIR /var/www/html/wp-content/plugins/
COPY ./plugins/*.zip ./
RUN unzip -q "*.zip"
RUN chown -R www-data:www-data .
RUN find . -name '*.zip' -delete
# Reset workdir
WORKDIR /var/www/html/
更新
当我检查docker容器中的目录时
docker exec -it theme_wordpress_1 bash
-rw-r----- 1 501 dialout 5.3K Nov 12 08:57 acf-to-wp-api.1.3.2.zip
-rw-r----- 1 root root 1.1M Nov 12 08:52 advanced-custom-fields.4.4.3.zip
drwxr-xr-x 4 www-data www-data 4.0K Sep 15 14:58 akismet
-rw-r--r-- 1 www-data www-data 2.3K May 22 2013 hello.php
-rw-r--r-- 1 www-data www-data 28 Jun 5 2014 index.php
-rw-r----- 1 root root 134K Nov 12 08:57 rest-api.2.0-beta5.zip
看起来有点奇怪,即使解压缩不起作用,我认为chown会工作,但上传的zip文件由root拥有。
这怎么可能?
答案 0 :(得分:1)
为避免shell解释通配符(CPTPlotArea *thePlotArea = self.plotArea;
CGRect plotAreaBounds = thePlotArea.bounds;
CGPoint anchor = self.centerAnchor;
CGPoint centerPoint = CPTPointMake(plotAreaBounds.origin.x + plotAreaBounds.size.width * anchor.x,
plotAreaBounds.origin.y + plotAreaBounds.size.height * anchor.y);
centerPoint = [self convertPoint:centerPoint fromLayer:thePlotArea];
if ( self.alignsPointsToPixels ) {
centerPoint = CPTAlignPointToUserSpace(context, centerPoint);
}
),请尝试将其包装在命令shell中:
*