How to use the build statement in Portainer?

Dear all,

I need to create a stack in Portainer for Zabbix software, and I just want to add the ‘curl’ command into my image.

This is my docker-compose file :

version: “3”
services:
zabbix-server:
build:
context: /mnt/docker/portainer/Dockerfiles/zabbix
dockerfile: Dockerfile
container_name: zabbix-server
ports:
- “10051:10051”
- “10050:10050”
environment:
[…]

My Dockerfile looks very simple :

FROM zabbix/zabbix-server-mysql:alpine-5.0-latest

RUN apt-get update && apt-get install -y curl

Portainer is however complaining not being able to find the path /mnt/docker/portainer/Dockerfiles/zabbix

Knowing that Portainer is also dockerized on my system, I just thinking about how this is actually doable…

Any insight would be much appreciated

Cheers

@Rajstopy7.4 Hello How are you?

How are you starting the image? If you make a volume in the Portainer Container it should alleviate the issue.

Here is the way you should be building the image via Portainer:
Build an Image in Portainer

Please let me know if this helps any at all.
Michael