Replies: 11 comments
-
|
Would be nice if I can upload |
Beta Was this translation helpful? Give feedback.
-
|
Using our Git functionality, it is possible to build an image. Keep in mind any paths for build need to be relative as we clone the repo into Portainer container’s file system. |
Beta Was this translation helpful? Give feedback.
-
|
Yes, I know that option. But I do not have private repository and do not want to share my code with third parties, so |
Beta Was this translation helpful? Give feedback.
-
|
Fair enough, re-opening as an enhancement request. |
Beta Was this translation helpful? Give feedback.
-
|
I would definitely like this feature to be implemented. Issue #7018 would be the ideal solution. But for now, I found a workaround. A non-optimal solution, yes, but at least it works. If you read the error message that is shown when referencing a Dockerfile inside your docker-compose.yml while using Portainer to spin your docker up, you can observe that no matter what path you specify for your Dockerfile, Portainer will try to find that path inside its data volume (which is called "portainer_data" if you have installed Portainer as per the official documentation). So, from the standpoint of Portainer, the path that is searched for your Dockerfile is: "/SOME/PATH/compose/SOMENUMBER/{THE_PATH_YOU_SPECIFIED}". Since, the default location for your docker volumes is "/docker/volumes/portainer_data/_data", you can create a folder just for storing Dockerfiles per app and specify the relative path to your Dockerfile in the docker-compose.yml inside Portainer. For example: portainer_data
|_ _data
|_compose
| |_SOME_NUMBER
| |_docker-compose.yml
| |_.env
|
|_SOME_NAME
|_MY_APP
|_Dockerfile
Specify your build path like this in your docker-compose.yml: version: "3"
services:
server:
build: ../../SOME_NAME/MY_APP/Dockerfile
This way, you can have Portainer build the relevant image according to your Dockerfile. Edit: Refine graphical representation of directory tree. |
Beta Was this translation helpful? Give feedback.
-
|
I wanted to follow up on this request. We had an internal request that is a bit related here that was resolved in 2.16. Have you upgraded? And, can provide feedback? Thanks! |
Beta Was this translation helpful? Give feedback.
-
|
@tamarahenson I do not know how it was resolved. I did not upgrade. I just using WA, provided by @lyh16. |
Beta Was this translation helpful? Give feedback.
-
|
I wanted to follow up on this request. Upon upgrade, has the issue been resolved? Thanks! |
Beta Was this translation helpful? Give feedback.
-
|
@tamarahenson |
Beta Was this translation helpful? Give feedback.
-
|
Can anyone share a complete Dockerfile? When I try to write a Dockerfile, it causes errors. /var/www/html/Explorer/portainer |
Beta Was this translation helpful? Give feedback.
-
|
I can confirm that this issue still persists in Portainer Community Edition 2.33.3 LTS. If you refer to the Docker Compose documentation in the web UI, |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Before you start, we need a little bit more information from you:
Use Case: Using Portainer at Home
Have you reviewed our technical documentation and knowledge base? Yes
Question:
If I have next compose.yaml:
I get error:
Deployment error failed to deploy a stack: Building api Cannot locate specified Dockerfile: modules.Dockerfile : exit status 1When I provide absolute path:
Deployment error failed to deploy a stack: build path /home/kes/work/projects/Proj-DevEnv/xx either does not exist, is not accessible, or is not a valid URL. : exit status 1How to upload into portainer my custom
Dockerfile?Beta Was this translation helpful? Give feedback.
All reactions