mirror of https://gitlab.com/tildes/tildes.git
Browse Source
docker: add Dockerfile, update Vagrantfile to add Docker provider
docker: add Dockerfile, update Vagrantfile to add Docker provider
also update VM to Debian 12 Bookworm (was Debian 10 Buster)merge-requests/157/head
2 changed files with 53 additions and 13 deletions
@ -0,0 +1,33 @@ |
|||
FROM debian:12 |
|||
ENV container docker |
|||
|
|||
RUN useradd --create-home vagrant \ |
|||
&& echo "vagrant:vagrant" | chpasswd \ |
|||
&& groupadd wheel \ |
|||
&& usermod -a -G wheel vagrant |
|||
|
|||
# allow vagrant to login |
|||
RUN cd ~vagrant \ |
|||
&& mkdir .ssh \ |
|||
&& echo "ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA6NF8iallvQVp22WDkTkyrtvp9eWW6A8YVr+kz4TjGYe7gHzIw+niNltGEFHzD8+v1I2YJ6oXevct1YeS0o9HZyN1Q9qgCgzUFtdOKLv6IedplqoPkcmF0aYet2PkEDo3MlTBckFXPITAMzF8dJSIFo9D8HfdOV0IAdx4O7PtixWKn5y2hMNG0zQPyUecp4pzC6kivAIhyfHilFR61RGL+GPXQ2MWZWFYbAGjyiYJnAmCP3NOTd0jMZEnDkbUvxhMmBYSdETk1rRgm+R4LOzFUGaHqHDLKLX+FIPKcF96hrucXzcWyLbIbEgE98OHlnVYCzRdK8jlqm8tehUc9c9WhQ== vagrant insecure public key" > .ssh/authorized_keys \ |
|||
&& chown -R vagrant:vagrant .ssh \ |
|||
&& chmod 0700 .ssh \ |
|||
&& chmod 0600 .ssh/authorized_keys |
|||
|
|||
EXPOSE 22 |
|||
|
|||
# install sudo, sshd, git, python3 |
|||
RUN apt-get update && apt-get install -y sudo openssh-server git python3 |
|||
|
|||
# Enable passwordless sudo for the "vagrant" user |
|||
RUN mkdir -p /etc/sudoers.d |
|||
RUN install -b -m 0440 /dev/null /etc/sudoers.d/vagrant |
|||
RUN echo 'vagrant ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers.d/vagrant |
|||
|
|||
# Use systemd replacement script to simulate systemd in Docker |
|||
# https://github.com/gdraheim/docker-systemctl-replacement |
|||
COPY systemctl3.py /usr/bin/systemctl |
|||
RUN test -e /bin/systemctl || ln -sf /usr/bin/systemctl /bin/systemctl |
|||
RUN chmod 0755 /usr/bin/systemctl |
|||
RUN systemctl enable ssh |
|||
CMD ["/usr/bin/systemctl"] |
Write
Preview
Loading…
Cancel
Save
Reference in new issue