Persistence
This commit is contained in:
parent
06eb99c84a
commit
0f936362d8
|
@ -9,14 +9,15 @@ RUN mkdir /var/run/sshd
|
||||||
# SSH login fix. Otherwise user is kicked off after login
|
# SSH login fix. Otherwise user is kicked off after login
|
||||||
RUN sed 's@session\s*required\s*pam_loginuid.so@session optional pam_loginuid.so@g' -i /etc/pam.d/sshd
|
RUN sed 's@session\s*required\s*pam_loginuid.so@session optional pam_loginuid.so@g' -i /etc/pam.d/sshd
|
||||||
|
|
||||||
ADD eshell /usr/bin/
|
COPY tmp/eshell /usr/bin/
|
||||||
|
|
||||||
COPY Gemfile* /tmp/
|
COPY tmp/Gemfile* /tmp/
|
||||||
WORKDIR /tmp
|
WORKDIR /tmp
|
||||||
RUN bundle install
|
RUN bundle install
|
||||||
|
|
||||||
ENV app /app
|
ENV app /app
|
||||||
RUN mkdir $app
|
RUN mkdir $app
|
||||||
|
COPY tmp/run_server.sh /app/
|
||||||
WORKDIR $app
|
WORKDIR $app
|
||||||
|
|
||||||
#ENV BUNDLE_PATH /box
|
#ENV BUNDLE_PATH /box
|
||||||
|
@ -25,4 +26,4 @@ WORKDIR $app
|
||||||
VOLUME /home
|
VOLUME /home
|
||||||
|
|
||||||
EXPOSE 22
|
EXPOSE 22
|
||||||
CMD ["/usr/sbin/sshd", "-D"]
|
ENTRYPOINT ["/app/run_server.sh"]
|
||||||
|
|
|
@ -1,4 +1,8 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
cp ../eshell ./
|
mkdir tmp
|
||||||
cp ../Gemfile* ./
|
cp ../init_passwd.rb ./tmp/
|
||||||
|
cp ../run_server.sh ./tmp/
|
||||||
|
cp ../eshell ./tmp/
|
||||||
|
cp ../Gemfile* ./tmp/
|
||||||
docker build -t emacs-collab:latest .
|
docker build -t emacs-collab:latest .
|
||||||
|
rm -R tmp
|
||||||
|
|
6
init_passwd.rb
Normal file
6
init_passwd.rb
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
require_relative '/emacs-collab/lib/emacscollab/collab'
|
||||||
|
|
||||||
|
EmacsCollab.get_projects.each do |p|
|
||||||
|
`groupadd -g #{p.uid} #{p.posixname}`
|
||||||
|
`useradd -d /home/#{p.posixname} -g #{p.uid} -M -s /usr/bin/eshell -u #{p.uid} #{p.posixname}`
|
||||||
|
end
|
4
run_server.sh
Executable file
4
run_server.sh
Executable file
|
@ -0,0 +1,4 @@
|
||||||
|
#!/bin/sh
|
||||||
|
cd /emacs-collab
|
||||||
|
ruby init_passwd.rb
|
||||||
|
/usr/sbin/sshd -D
|
Loading…
Reference in New Issue
Block a user