Docker has me stumped

Hi

I’m trying to copy index.html into the data diectory inside Docker but for the life of me I can’t get Docker to copy it.

My Dockerfile

ARG BUILD_FROM
FROM $BUILD_FROM

ENV LANG C.UTF-8

RUN apk add --no-cache python3

# Python 3 HTTP Server serves the current working dir
# So let’s set it to our add-on persistent data directory.
WORKDIR /data

# Copy data for add-on
COPY run.sh /
COPY index.html /data/
RUN chmod a+x /run.sh

CMD [ “/run.sh” ]

Any ideas?

Thanks
Bruce

You’re not using the prebuild images ?

You could always have a look at the official dockerfile here:
https://hub.docker.com/r/homeassistant/home-assistant/~/dockerfile/

I’m trying to build my own add-on using a raspberry pi running a built in image.

I have samba access setup to develop the scripts.

I can copy index.html to the root of the docker sandbox but I can’t copy it to data and I’ve tried every last thing I can think of

/data is not available when building the image. You’ll need to copy it to a different location then use run.sh to copy it to /data after the container is instantiated.

Ah thanks for that. It was driving me crazy