brewedbits.dev

Personal blog with guides and news on selfhosting, Linux and AI, from the Netherlands

nextDash nextdash --aboutYour bookmarks. Your terminal. checks your links knows your Docker host one container, no cloudLive demo →nextdash.cc ↗

Tip: portainer builds images from a Dockerfile in the browser, but COPY cannot see the host

Portainer
~/tips/tip-portainer-build-image-web-editor-copy

FROM alpine:3.20

Builds a Docker image straight from the Portainer interface and shows the limits of COPY.

Images, Build a new image lets me test a Dockerfile without a shell on the host. There is one limit to know first.

FROM alpine:3.20
RUN apk add --no-cache wget
RUN wget -O /opt/config.json https://example.com/config.json

Pick Web editor, Upload or a URL as the build method, give the image a name, then press Build the image. The Output tab keeps the build log. When the host has several nodes, choose the node that gets the image.

The docs say ADD and COPY cannot use files on the host, so fetch things with wget from a URL as above. Files you upload through the Select files button are included in the build.

Further reading: Portainer docs: Build a new image

More Portainer tips Choose Polling in a Portainer GitOps update when your Git host can't reach Portainer Put Portainer environments in groups and give users access to a whole group Portainer's Edge Agent checks in every 5 seconds, and you can change that docker run -d -p 9001:9001 --name portainer_agent --restart=always \ Deploy the container → Replace All Portainer tips (28) All topics

Link