@@ -2,42 +2,38 @@ FROM ubuntu:18.04
2
2
3
3
RUN sed -i s/^deb-src.*// /etc/apt/sources.list
4
4
5
- RUN apt-get update && apt-get install --yes sudo python python-pip vim git-core crudini jq && \
6
- pip install --upgrade pip && \
5
+ RUN apt-get update && apt-get install --yes sudo python3-dev python3-pip vim git-core crudini jq && \
6
+ apt clean && \
7
+ pip3 --no-cache-dir install --upgrade pip setuptools && \
7
8
useradd -u 65500 -m rally && \
8
9
usermod -aG sudo rally && \
9
- echo "rally ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/00-rally-user
10
+ echo "rally ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/00-rally-user && \
11
+ mkdir /rally && chown -R rally:rally /rally
10
12
11
- COPY etc/motd /etc/motd
12
- WORKDIR /opt/rundeck
13
- COPY bindep.txt /opt/rundeck/
13
+ RUN pip install git+https://github.com/openstack/rally-openstack.git --constraint https://raw.githubusercontent.com/openstack/rally-openstack/master/upper-constraints.txt --no-cache-dir && \
14
+ pip3 install pymysql psycopg2-binary --no-cache-dir
14
15
15
- # ensure that we have all system packages installed
16
- RUN pip install bindep && apt-get install --yes $(bindep -b | tr '\n ' ' ' )
17
-
18
- RUN pip install git+https://github.com/openstack/rally-openstack.git --constraint https://raw.githubusercontent.com/openstack/rally-openstack/master/upper-constraints.txt && \
19
- pip install pymysql && \
20
- pip install psycopg2 && \
21
- mkdir /etc/rally && \
22
- echo "[database]" > /etc/rally/rally.conf && \
23
- echo "connection=sqlite:////home/rally/data/rally.db" >> /etc/rally/rally.conf
16
+ COPY ./etc/motd_for_docker /etc/motd
24
17
RUN echo '[ ! -z "$TERM" -a -r /etc/motd ] && cat /etc/motd' >> /etc/bash.bashrc
25
- # Cleanup pip
26
- RUN rm -rf /root/.cache/
27
-
28
- # Pre-download tempest to speed up runs
29
- RUN git clone --bare https://opendev.org/openstack/tempest /opt/tempest
30
18
31
19
USER rally
32
20
ENV HOME /home/rally
33
- RUN mkdir -p /home/rally/data && mkdir ~/.rally && cp /etc/rally/rally.conf ~/.rally/ && rally db recreate &&\
34
- rally verify create-verifier --name default --type tempest
21
+ RUN mkdir -p /home/rally/.rally
22
+
23
+ RUN touch ~/.rally/rally.conf
24
+ RUN crudini --set ~/.rally/rally.conf database connection sqlite:////home/rally/.rally/rally.db
25
+
26
+ RUN rally db recreate
27
+
28
+ # Docker volumes have specific behavior that allows this construction to work.
29
+ # Data generated during the image creation is copied to volume only when it's
30
+ # attached for the first time (volume initialization)
31
+ RUN rally verify create-verifier --name default --type tempest
35
32
36
33
COPY bin/rally-verify-wrapper.sh /usr/bin/rally-verify-wrapper.sh
37
34
COPY bin/rally-extract-tests.sh /usr/bin/rally-extract-tests.sh
38
35
39
- # Docker volumes have specific behavior that allows this construction to work.
40
36
# Data generated during the image creation is copied to volume only when it's
41
37
# attached for the first time (volume initialization)
42
- VOLUME ["/home/rally/data " ]
43
- ENTRYPOINT ["rally " ]
38
+ VOLUME ["/home/rally/.rally " ]
39
+ ENTRYPOINT ["/bin/bash " ]
0 commit comments