Skip to content
Snippets Groups Projects
Commit 59fba96d authored by Mate Farkas's avatar Mate Farkas
Browse files

Vagrant-compatible AmazonLinux image has been added.

parent c65e395e
No related branches found
No related tags found
No related merge requests found
FROM amazonlinux:2017.03
MAINTAINER Mate Farkas <mate.farkas@sch.hu>
RUN yum install --assumeyes \
openssh-server \
sudo \
vim
ADD etc/environment /etc/environment
RUN useradd -m -s /bin/bash vagrant
ADD home/vagrant/.ssh/authorized_keys /home/vagrant/.ssh/authorized_keys
RUN chmod 0700 /home/vagrant/.ssh/
RUN chmod 0600 /home/vagrant/.ssh/authorized_keys
RUN chown -R vagrant. /home/vagrant/
ADD etc/sudoers.d/vagrant /etc/sudoers.d/vagrant
ADD sbin/mini-init /sbin/mini-init
RUN chmod u+x /sbin/mini-init
ADD etc/mini-init /etc/mini-init
EXPOSE 22
CMD /sbin/mini-init
TAG='matefarkas/amazonlinux:base'
all:
docker build --tag ${TAG} ${PWD}
test:
docker run --interactive --tty --rm ${TAG} bash || true
# matefarkas/amazonlinux:base
Finally there's an official AmazonLinux image available.
Let's make it work with Vagrant.
## AuFS problems
The original image works, but fails to install essential packages.
Setting the devicemapper driver in */etc/docker/daemon.json* solves the problem.
{
"storage-driver": "devicemapper"
}
LC_ALL="C"
LC_CTYPE="C"
LC_MESSAGES="C"
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
#!/bin/bash
mkdir -p /var/run/sshd
/usr/bin/ssh-keygen -A
/usr/sbin/sshd -D -f /etc/ssh/sshd_config
vagrant ALL=(ALL) NOPASSWD: ALL
ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA6NF8iallvQVp22WDkTkyrtvp9eWW6A8YVr+kz4TjGYe7gHzIw+niNltGEFHzD8+v1I2YJ6oXevct1YeS0o9HZyN1Q9qgCgzUFtdOKLv6IedplqoPkcmF0aYet2PkEDo3MlTBckFXPITAMzF8dJSIFo9D8HfdOV0IAdx4O7PtixWKn5y2hMNG0zQPyUecp4pzC6kivAIhyfHilFR61RGL+GPXQ2MWZWFYbAGjyiYJnAmCP3NOTd0jMZEnDkbUvxhMmBYSdETk1rRgm+R4LOzFUGaHqHDLKLX+FIPKcF96hrucXzcWyLbIbEgE98OHlnVYCzRdK8jlqm8tehUc9c9WhQ== vagrant insecure public key
#!/bin/bash
CONFDIR="/etc/mini-init"
LOGFILE="/var/log/mini-init.log"
for file in `ls $CONFDIR`
do
script="$CONFDIR/$file"
echo "Running startup script: $script" >> $LOGFILE
bash -x $script &>> $LOGFILE
echo "Startup script [$script] finished with exit code: $?" >> $LOGFILE
done
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment