~mapperr/dockerfiles

a1cea9d940e541b305a9b8695a0542a38cab18a5 — mapperr 6 months ago 9a9d3c4
laminar: fix
2 files changed, 13 insertions(+), 8 deletions(-)

M laminarCI/Dockerfile
M laminarCI/entry.sh
M laminarCI/Dockerfile => laminarCI/Dockerfile +5 -1
@@ 4,6 4,7 @@ FROM laminarci/laminar

USER root


COPY --from=docker:dind /usr/local/bin/docker /bin/
RUN \
    apk add --no-cache -X http://dl-3.alpinelinux.org/alpine/edge/testing/ \


@@ 13,5 14,8 @@ RUN \
    ssh-keygen -A

ADD entry.sh /entry.sh
RUN \
    chmod a+x /entry.sh

ENTRYPOINT [ "/entry.sh" ]
ENTRYPOINT [ "/sbin/tini", "--" ]
CMD [ "/entry.sh" ]

M laminarCI/entry.sh => laminarCI/entry.sh +8 -7
@@ 1,12 1,13 @@
#!/bin/sh -ex

if ! test -z "$LAMINAR_ENABLE_SSH"; then
    mkdir /var/lib/laminar/.ssh && \
    chown laminar:users /var/lib/laminar/.ssh && \
    chmod 700 /var/lib/laminar/.ssh && \
    sed -i -e 's#^laminar:x:100:100:Laminar:/var/lib/laminar:/sbin/nologin#laminar:x:100:100:Laminar:/var/lib/laminar:/bin/bash#' /etc/passwd && \
    sed -i -e 's/^laminar:!:/laminar:*:/' /etc/shadow && \
    chmod a+x /entry.sh
    test -d /var/lib/laminar/.ssh &&
        rm -rf /var/lib/laminar/.ssh
    mkdir /var/lib/laminar/.ssh
    chown laminar:users /var/lib/laminar/.ssh
    chmod 700 /var/lib/laminar/.ssh
    sed -i -e 's#^laminar:x:100:100:Laminar:/var/lib/laminar:/sbin/nologin#laminar:x:100:100:Laminar:/var/lib/laminar:/bin/bash#' /etc/passwd
    sed -i -e 's/^laminar:!:/laminar:*:/' /etc/shadow
    for pubkey in $(ls /etc/authorized_keys); do
        cat /etc/authorized_keys/$pubkey \
            >> /var/lib/laminar/.ssh/authorized_keys


@@ 15,4 16,4 @@ if ! test -z "$LAMINAR_ENABLE_SSH"; then
    exec /usr/sbin/sshd -D -e "$@" &
fi

su -l laminar -s /bin/sh -c laminard
su laminar -c laminard