This might be more of a docker issue, tbh, however I haven’t been able to found anything useful so I’ll ask here regardless.
I’m trying to build and deploy an app, and it builds fine and alright, but then the deploy fails.
Project structure:
project-root
app
configs
...
src
...
start.sh
Dockerfile
flask
src
...
Dockerfile
docker-compose.yml
The content of docker-compose.yml:
services:
app:
privileged: true
build: ./app
restart: always
network_mode: 'host'
flask:
restart: always
build: ./flask
network_mode: 'host'
ports:
- '80:80'
And the content of the failing Dockerfile:
FROM balenalib/raspberrypi3-debian-python:3-buster-build
ENV UDEV=1
ENV INITSYSTEM on
WORKDIR /usr/src/app
RUN apt-get update && \
apt-get install -yq \
supervisor
...
COPY start.sh ./
COPY src ./
COPY ./configs/supervisor_confd/* /etc/supervisor/conf.d/
COPY ./configs/owfs.conf /etc
CMD ["bash", "start.sh"]
After a successful build, the following deploy fails with:
[Error] Deploy failed
Error: COPY failed: stat /var/lib/docker/tmp/docker-builder124511649/src: no such file or directory
at Stream.<anonymous> (C:\snapshot\resin-cli\node_modules\resin-docker-build\build\builder.js:178:23)
at Stream.stream.write (C:\snapshot\resin-cli\node_modules\through\index.js:26:11)
at Stream.ondata (internal/streams/legacy.js:16:26)
at emitOne (events.js:96:13)
at Stream.emit (events.js:188:7)
at drain (C:\snapshot\resin-cli\node_modules\through\index.js:36:16)
at Stream.stream.queue.stream.push (C:\snapshot\resin-cli\node_modules\through\index.js:45:5)
at Parser.exports.parse.parser.onToken (C:\snapshot\resin-cli\node_modules\JSONStream\index.js:132:18)
at Parser.proto.write (C:\snapshot\resin-cli\node_modules\jsonparse\jsonparse.js:135:34)
at Stream.<anonymous> (C:\snapshot\resin-cli\node_modules\JSONStream\index.js:23:12)
at Stream.stream.write (C:\snapshot\resin-cli\node_modules\through\index.js:26:11)
at IncomingMessage.ondata (_stream_readable.js:555:20)
at emitOne (events.js:96:13)
at IncomingMessage.emit (events.js:188:7)
at readableAddChunk (_stream_readable.js:176:18)
at IncomingMessage.Readable.push (_stream_readable.js:134:10)
at HTTPParser.parserOnBody (_http_common.js:123:22)
at Socket.socketOnData (_http_client.js:363:20)
at emitOne (events.js:96:13)
at Socket.emit (events.js:188:7)
at readableAddChunk (_stream_readable.js:176:18)
at Socket.Readable.push (_stream_readable.js:134:10)
at Pipe.onread (net.js:547:20)
The command with which I run the proces is:
DEBUG=1 balena deploy testApp2 --logs --source . --emulated --build --docker=//./pipe/docker_engine
It appears that the COPY fails when trying to execute COPY src ./
. This seems like an issue with how paths are evaluated when docker-compose is run or something, though I haven’t been able to find a solution.
Kind regards