-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathblock1.dockerfile
54 lines (44 loc) · 1.85 KB
/
block1.dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
FROM ubuntu:20.04
# add openstack user
RUN apt update -y
RUN apt install -y sudo
RUN useradd -m -d /home/cinder --uid 1000 -s /bin/bash cinder
RUN useradd -m -d /home/openstack -s /bin/bash openstack
RUN echo 'cinder:password' | chpasswd
RUN echo 'openstack:password' | chpasswd
RUN echo 'root:password' | chpasswd
RUN usermod -aG sudo openstack
RUN usermod -aG sudo cinder
RUN echo 'openstack ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
RUN cp /usr/share/base-files/dot.profile /home/openstack/.profile
RUN cp /usr/share/base-files/dot.bashrc /home/openstack/.bashrc
RUN cp /usr/share/base-files/dot.profile /home/cinder/.profile
RUN cp /usr/share/base-files/dot.bashrc /home/cinder/.bashrc
RUN chown -R openstack:openstack /home/openstack
RUN chown -R cinder:cinder /home/cinder
# install packages
RUN apt install -y crudini
RUN apt install -y software-properties-common
RUN add-apt-repository cloud-archive:yoga -y
# configure NTP
# RUN apt install -y chrony
# RUN sed -i "/^pool .* iburst maxsources [0-9]$/d" /etc/chrony/chrony.conf
# RUN echo "server os-controller iburst" >> /etc/chrony/chrony.conf
# RUN service chrony restart
RUN apt install -y thin-provisioning-tools cinder-volume nfs-common
# install mysql client
RUN apt install -y python3-pymysql
RUN apt install -y vim
RUN apt install -y net-tools
RUN apt install -y iputils-ping tcpdump iproute2
RUN apt install -y tini
RUN apt install -y netcat
ADD --chown=root:root block1_setup.sh /root/block1_setup.sh
ADD --chown=openstack:openstack admin_openrc /home/openstack/admin_openrc
ADD --chown=openstack:openstack demo_openrc /home/openstack/demo_openrc
ADD --chown=root:root ./config/profile.d/99-generate_env.sh /etc/profile.d/99-generate_env.sh
WORKDIR /root
USER root
RUN apt autoclean -y & apt autoremove -y
RUN echo "source /etc/profile.d/99-generate_env.sh" >> /etc/bash.bashrc
CMD ["tini", "--", "/root/block1_setup.sh"]