Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VVV specific dockerfile, gets built on provision #2687

Draft
wants to merge 1 commit into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 60 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
FROM ubuntu:20.04

LABEL maintainer="[email protected]"

ENV DEBIAN_FRONTEND noninteractive

# install common dependencies
# ca-certificates usually needed by vagrant to download stuff
# some others are just attempt to speed the provision up
RUN apt-get update && apt-get install -y \
locales \
curl \
lsb-release \
openssh-server \
sudo \
python \
ca-certificates \
gnupg2 \
software-properties-common \
apt-utils \
iputils-ping \
net-tools \
nano \
less

## in case ca-cert already installed, force upgrade ( to get latest chain )
RUN apt-get upgrade -y ca-certificates

# ensure we have the en_US.UTF-8 locale available
RUN locale-gen en_US.UTF-8

# setup the vagrant user
RUN if ! getent passwd vagrant; then useradd -d /home/vagrant -m -s /bin/bash vagrant; fi \
&& echo vagrant:vagrant | chpasswd \
&& echo 'vagrant ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers \
&& mkdir -p /etc/sudoers.d \
&& echo 'vagrant ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers.d/vagrant \
&& chmod 0440 /etc/sudoers.d/vagrant

# add the vagrant insecure public key
RUN mkdir -p /home/vagrant/.ssh \
&& chmod 0700 /home/vagrant/.ssh \
&& wget --no-check-certificate \
https://raw.githubusercontent.com/hashicorp/vagrant/main/keys/vagrant.pub \
-O /home/vagrant/.ssh/authorized_keys \
&& chmod 0600 /home/vagrant/.ssh/authorized_keys \
&& chown -R vagrant /home/vagrant/.ssh

# don't clean packages, we might be using vagrant-cachier
RUN rm /etc/apt/apt.conf.d/docker-clean

# create the privilege separation directory for sshd
RUN mkdir -p /run/sshd

# run sshd in the foreground
CMD /usr/sbin/sshd -D \
-o UseDNS=no\
-o UsePAM=no\
-o PasswordAuthentication=yes\
-o PidFile=/tmp/sshd.pid
3 changes: 2 additions & 1 deletion Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,8 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|

# Docker use image.
config.vm.provider :docker do |d, override|
d.image = 'pentatonicfunk/vagrant-ubuntu-base-images:20.04'
d.build_dir = "."
#d.image = 'vvvlocal/vvv-ubuntu-base:20.04'
d.has_ssh = true
d.ports = [ "80:80" ] # HTTP
d.ports += [ "443:443" ] # HTTPS
Expand Down
Loading