@@ -1129,15 +1129,15 @@ RUN apt-get update && apt-get install -y ...
1129
1129
ADD has two forms:
1130
1130
1131
1131
```dockerfile
1132
- ADD [--chown=<user>:<group>] [--checksum=<checksum>] <src>... <dest>
1133
- ADD [--chown=<user>:<group>] ["<src>" ,... "<dest>" ]
1132
+ ADD [--chown=<user>:<group>] [--chmod=<perms>] [-- checksum=<checksum>] <src>... <dest>
1133
+ ADD [--chown=<user>:<group>] [--chmod=<perms>] [ "<src>" ,... "<dest>" ]
1134
1134
```
1135
1135
1136
1136
The latter form is required for paths containing whitespace.
1137
1137
1138
1138
> ** Note**
1139
1139
>
1140
- > The ` --chown ` feature is only supported on Dockerfiles used to build Linux containers,
1140
+ > The ` --chown ` and ` --chmod ` features are only supported on Dockerfiles used to build Linux containers,
1141
1141
> and will not work on Windows containers. Since user and group ownership concepts do
1142
1142
> not translate between Linux and Windows, the use of ` /etc/passwd ` and ` /etc/group ` for
1143
1143
> translating user and group names to IDs restricts this feature to only be viable
@@ -1206,6 +1206,7 @@ ADD --chown=55:mygroup files* /somedir/
1206
1206
ADD --chown=bin files* /somedir/
1207
1207
ADD --chown=1 files* /somedir/
1208
1208
ADD --chown=10:11 files* /somedir/
1209
+ ADD --chown=myuser:mygroup --chmod=655 files* /somedir/
1209
1210
```
1210
1211
1211
1212
If the container root filesystem does not contain either ` /etc/passwd ` or
@@ -1361,15 +1362,15 @@ See [`COPY --link`](#copy---link).
1361
1362
COPY has two forms:
1362
1363
1363
1364
``` dockerfile
1364
- COPY [--chown=<user>:<group>] <src>... <dest>
1365
- COPY [--chown=<user>:<group>] ["<src>" ,... "<dest>" ]
1365
+ COPY [--chown=<user>:<group>] [--chmod=<perms>] <src>... <dest>
1366
+ COPY [--chown=<user>:<group>] [--chmod=<perms>] [ "<src>" ,... "<dest>" ]
1366
1367
```
1367
1368
1368
1369
This latter form is required for paths containing whitespace
1369
1370
1370
1371
> ** Note**
1371
1372
>
1372
- > The ` --chown ` feature is only supported on Dockerfiles used to build Linux containers,
1373
+ > The ` --chown ` and ` --chmod ` features are only supported on Dockerfiles used to build Linux containers,
1373
1374
> and will not work on Windows containers. Since user and group ownership concepts do
1374
1375
> not translate between Linux and Windows, the use of ` /etc/passwd ` and ` /etc/group ` for
1375
1376
> translating user and group names to IDs restricts this feature to only be viable for
@@ -1437,6 +1438,7 @@ COPY --chown=55:mygroup files* /somedir/
1437
1438
COPY --chown=bin files* /somedir/
1438
1439
COPY --chown=1 files* /somedir/
1439
1440
COPY --chown=10:11 files* /somedir/
1441
+ COPY --chown=myuser:mygroup --chmod=644 files* /somedir/
1440
1442
```
1441
1443
1442
1444
If the container root filesystem does not contain either ` /etc/passwd ` or
0 commit comments