Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Dockerfile Unknown flag: chown

Tags:

docker

My Dockerfile is failing on the below step:

ADD --chown=user:user test.py /etc/test

Any suggestions on how can I fix it? I am using AWS EC2 instance RHEL 7.6 Updating with docker version output below:

Client:
 Version:         1.13.1
 API version:     1.26
 Package version: docker-1.13.1-88.git07f3374.el7.x86_64
 Go version:      go1.10.2
 Git commit:      07f3374/1.13.1
 Built:           Thu Dec  6 07:01:49 2018
 OS/Arch:         linux/amd64

Server:
 Version:         1.13.1
 API version:     1.26 (minimum version 1.12)
 Package version: docker-1.13.1-88.git07f3374.el7.x86_64
 Go version:      go1.10.2
 Git commit:      07f3374/1.13.1
 Built:           Thu Dec  6 07:01:49 2018
 OS/Arch:         linux/amd64
 Experimental:    false

Please advice on how to update to more latest verison of docker if that's the issue

like image 380
kpratihast Avatar asked Sep 16 '25 15:09

kpratihast


1 Answers

Docker 17.09+ is required for this syntax. I think you may need upgrade your Docker.

Or just try change to these lines:

ADD test.py /etc/test
RUN sudo chown -R user:user /etc/test/test.py
like image 117
Chien Nguyen Avatar answered Sep 19 '25 07:09

Chien Nguyen