Commit 71530909 authored by Dmitriy Safronov's avatar Dmitriy Safronov
Browse files

initial

parent 758f71ef
Loading
Loading
Loading
Loading
Loading

.dockerignore

0 → 100644
+3 −0
Original line number Diff line number Diff line
/.gitlab-ci.yml
/.hadolint.yaml
/README.md

.gitlab-ci.yml

0 → 100644
+0 −0

Empty file added.

.hadolint.yaml

0 → 100644
+3 −0
Original line number Diff line number Diff line
ignored:
  - DL3008
  - DL3018

Dockerfile

0 → 100644
+15 −0
Original line number Diff line number Diff line
FROM registry.cyberbrain.pw/docker/alpine:latest

WORKDIR /tmp/openwrt

ENTRYPOINT [ "sh", "/entrypoint.sh" ]

RUN set -ex && \
    apk --no-cache add sudo git rsync openssh-client && \
    rm -rf /var/cache/apk/* && \
    addgroup -S openwrt && \
    adduser -S openwrt -G openwrt -h /home/openwrt && \
    chown -R openwrt:openwrt /tmp/openwrt

COPY entrypoint.sh /entrypoint.sh
COPY sync.sh /sync.sh

entrypoint.sh

0 → 100644
+14 −0
Original line number Diff line number Diff line
#!/usr/bin/env sh

die() {
    RED='\033[0;31m'
    NC='\033[0m' # No Color
    echo -e '\[ '"${RED}$1${NC}"' ]/'
    exit 1
}

rsync -a /opt/ /home/openwrt/.ssh/ || die "Couldn't rsync user ssh settings"
chown -R openwrt:openwrt /home/openwrt/.ssh || die "Couldn't change ownership for user ssh settings"
chmod -R a-rwx,u+rwX /home/openwrt/.ssh || die "Couldn't change access rights for user ssh settings"

exec sudo -u openwrt -g openwrt -E -H sh -c 'exec sh /sync.sh' || die "Couldn't run sync sript as user"
Loading