refactored container image and gitea workflows
All checks were successful
/ build-docker-image (push) Successful in 1m2s
All checks were successful
/ build-docker-image (push) Successful in 1m2s
This commit is contained in:
@@ -1,25 +1,48 @@
|
||||
FROM alpine:latest
|
||||
|
||||
# Install BorgBackup and OpenSSH client
|
||||
# Installs
|
||||
# - BorgBackup
|
||||
# - OpenSSH client
|
||||
RUN echo "Installing packages."
|
||||
RUN apk update && apk add --no-cache \
|
||||
borgbackup \
|
||||
openssh \
|
||||
bash \
|
||||
tzdata
|
||||
|
||||
RUN echo "Copying app."
|
||||
COPY ./docker/app /app
|
||||
RUN chmod +x /app/scripts -R
|
||||
|
||||
|
||||
|
||||
# having some problems if app/scripts files not set with executable permissions
|
||||
# this is not working, so please confirm files are executable on host building docker file
|
||||
# setting app owner.
|
||||
# RUN chown -R root:root /app
|
||||
#RUN echo "Setting app permissions"
|
||||
#RUN chown -R root:root /app/scripts && find /app/scripts -type f -exec chmod +x {} \;
|
||||
# use this entrypoint to verify final permissions on container
|
||||
#ENTRYPOINT ["ls", "-lah", "/app/scripts"]
|
||||
|
||||
|
||||
RUN echo "creating symbolic links to app/scripts."
|
||||
RUN ln -s /app/scripts/loadenv /usr/local/bin/loadenv
|
||||
RUN ln -s /app/scripts/remote-connect /usr/local/bin/remote-connect
|
||||
RUN ln -s /app/scripts/remote-connect /usr/local/bin/remote-get-folder-size
|
||||
RUN ln -s /app/scriptsremote-get-folder-size /usr/local/bin/remote-get-folder-size
|
||||
|
||||
#RUN addgroup -g 1001 -S borg && adduser -u 1001 -S borg -G borg
|
||||
#USER borg
|
||||
#WORKDIR /app
|
||||
RUN echo "creating .ssh folder."
|
||||
RUN mkdir /root/.ssh
|
||||
RUN echo "setting .ssh folder permissions."
|
||||
RUN chmod 700 /root/.ssh
|
||||
|
||||
# for files inside correct permission is chmod 600 /root/.ssh/key
|
||||
|
||||
RUN echo "Setting loadenv to bashrc and bash_profile"
|
||||
|
||||
RUN echo "source /usr/local/bin/loadenv" > /root/.bash_profile
|
||||
RUN echo "source /usr/local/bin/loadenv" > /root/.bashrc
|
||||
|
||||
ENTRYPOINT ["bash" , "-c", "borg $0"]
|
||||
RUN echo "setting entrypoint."
|
||||
ENTRYPOINT ["/app/scripts/entrypoint.sh"]
|
||||
|
||||
CMD ["--help"]
|
||||
#CMD ["--help"]
|
||||
Reference in New Issue
Block a user