-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Ahmad Iqbal Ali
authored
Nov 13, 2018
1 parent
aa3267e
commit 947e04a
Showing
2 changed files
with
19 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,20 @@ | ||
FROM debian:stretch | ||
FROM alpine:3.6 | ||
|
||
RUN apt-get update && apt-get install -y git | ||
COPY init.sh / | ||
RUN apk add --update git openssh | ||
|
||
ARG USER=1001 | ||
RUN addgroup -g 1000 -S git && \ | ||
adduser -u 1000 -S git -G git | ||
|
||
ADD [--chown=$USER:root] init.sh / | ||
RUN chmod +x /init.sh | ||
|
||
USER root | ||
|
||
RUN mkdir /root/.ssh/ && \ | ||
RUN mkdir /home/git/.ssh/ && \ | ||
chown git /home/git/.ssh && \ | ||
mkdir /repository && \ | ||
touch /root/.ssh/known_hosts && \ | ||
echo "\nStrictHostKeyChecking no" >> /etc/ssh/ssh_config | ||
|
||
RUN chgrp -R 0 /root && \ | ||
chmod -R g=u /root | ||
|
||
# Clean up | ||
RUN apt-get autoremove -y && apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* | ||
chown git /repository && \ | ||
touch /home/git/.ssh/known_hosts && \ | ||
echo "" >> /etc/ssh/ssh_config && \ | ||
echo "StrictHostKeyChecking no" >> /etc/ssh/ssh_config &&\ | ||
chown git /etc/ssh/ssh_config | ||
|
||
USER $USER | ||
USER git | ||
|
||
CMD ["/init.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters