Hi,
First of all this is more of an advice/help request than an issue. I am facing this issue hence reason I am here.
ubuntu@linux:~/hello-world$ tree -a
.
โโโ config
โย ย โโโ params.yml
โโโ docker
โย ย โโโ docker-compose.yml
โย ย โโโ .env
โย ย โโโ nginx
โย ย โโโ Dockerfile
โโโ .gitignore
โโโ index.html
โโโ Readme.md
โโโ src
โโโ controller
โโโ default.php
โโโ user.php
5 directories, 9 files
When I create my container(s), I want everything you see above copied into nginx_con container. Obviously Dockerfile below or similar ones won't work. How can I achieve this? What is the best practise?
nginx/Dockerfile
FROM nginx:1.13.8
...
COPY ./../ /usr/share/nginx/html
...
docker-compose.yml
version: '3'
services:
nginx_img:
container_name: nginx_con
build: ./nginx
ports:
- 1000:80
Thanks
If the structure above is too complex, I am happy to use structure below so content of src folder should be copied into /usr/share/nginx/html when I run docker-compose up.
ubuntu@linux:~/hello-world$ tree -a
.
โโโ docker-compose.yml
โโโ nginx
โย ย โโโ Dockerfile
โโโ src
โโโ Readme.md
โโโ config
โโโ index.php
โโโ ......
2 directories, 4 files
Try
build:
context: ..
dockerfile: ./nginx/Dockerfile
Thank you. Work perfectly fine.
I am facing same issue , can you please help
wget someurl | tar zxf - -C ${SP_HOME} && \
rm -rf ${SP_HOME}/config && \
chmod 555 /wrapper.sh
COPY ../newconfig ${SP_HOME}/config
Forbidden path outside the build context: ../newconfig ()
Build step 'Execute shell' marked build as failure
Most helpful comment
Try