Tell me how to build dockerfile so that a particular file in the container only runs when you first start
FROM alpine
COPY ./myscript.sh /myscript.sh
ENTRYPOINT ["/myscript.sh"]
There’s no reason it should ever get invoked again, only one process (usually) should be running per container.
You can also build the specify user by yourself
# ARG BUILD_UID=1001
# ARG BUILD_USER=noname
# RUN adduser --uid $BUILD_UID $BUILD_USER
# RUN usermod -a -G video,users ${BUILD_USER}
# ENV WORKDIR_PATH /home/${BUILD_USER}
# WORKDIR ${WORKDIR_PATH}
# USER ${BUILD_USER}