dockerfile - Error while running postgres on ubuntubase docker -
i'm practicing examples provided in book docker in practice chapter 3. below dockerfile mentioned run docker postgres.
from ubuntu:14.04 run apt-get update \ && debian_frontend=noninteractive apt-get install -y \ postgresql \ && apt-get clean \ && rm -rf /var/lib/apt/lists/* workdir /opt copy db /opt/db run service postgresql start && \ cat db/schema.sql | psql && \ service postgresql stop
but copy in step 4 gives me below error.
$ sudo docker build -t db . sending build context docker daemon 2.048kb step 1/4 : ubuntu:14.04 ---> c69811d4e993 step 2/4 : run apt-get update && debian_frontend=noninteractive apt-get install -y postgresql && apt-get clean && rm -rf /var/lib/apt/lists/* ---> using cache ---> 2ac4ff885d29 step 3/4 : copy db /opt/db copy failed: stat /var/lib/docker/tmp/docker-builder554911929/db: no such file or directory
when commented copy
command, i'm getting different error.
step 4/4 : run service postgresql start && cat db/schema.sql | psql && service postgresql stop ---> running in 79e47b45c41a * starting postgresql 9.3 database server ...done. cat: db/schema.sql: no such file or directory psql: fatal: role "root" not exist
copy db /opt/db
supposed copy db
current context (the folder executing docker build
from)
so make sure said current folder does include db
folder.
Comments
Post a Comment