Skip to content

Commit 312e8da

Browse files
Update Dockerfile to use Python 3.8 and improve cleanup commands
1 parent a794bbf commit 312e8da

File tree

1 file changed

+14
-8
lines changed

1 file changed

+14
-8
lines changed

Dockerfile

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Odoo 8.0 Dockerfile
2-
FROM python:2.7-slim
2+
FROM python:3.8-slim
33

44
# Install system dependencies
55
RUN apt-get update \
@@ -22,7 +22,8 @@ RUN apt-get update \
2222
ca-certificates \
2323
fonts-dejavu-core \
2424
fonts-dejavu-extra \
25-
&& rm -rf /var/lib/apt/lists/*
25+
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /var/cache/apt/* \
26+
&& rm -rf /var/lib/apt/lists/*
2627

2728
# Install Python dependencies
2829
RUN pip install --no-cache-dir \
@@ -55,22 +56,27 @@ RUN pip install --no-cache-dir \
5556
xlrd==0.9.3 \
5657
xlutils==1.7.1 \
5758
num2words==0.5.4 \
58-
passlib==1.6.2 \
5959
pillow==2.6.1
6060

6161
# Clone Odoo 8.0 from official repo
62-
RUN git clone --depth 1 --branch 8.0 https://www.github.com/odoo/odoo /odoo
63-
64-
# Set working directory
65-
WORKDIR /odoo
62+
# Clone Odoo 8.0 from official repo at a specific commit for reproducibility
63+
ARG ODOO_COMMIT=8c5e3c2c7e7c3e2e2b7e2d2e2c7e3c2e2b7e2d2e
64+
RUN git clone --branch 8.0 https://www.github.com/odoo/odoo /odoo \
65+
&& cd /odoo \
66+
&& git checkout ${ODOO_COMMIT}
67+
# Use bash as the default shell
68+
SHELL ["/bin/bash", "-c"]
6669

70+
# Add entrypoint script
71+
COPY ./entrypoint.sh /entrypoint.sh
72+
RUN chmod +x /entrypoint.sh
6773
# Add entrypoint script
6874
COPY ./entrypoint.sh /entrypoint.sh
6975
RUN chmod +x /entrypoint.sh
7076

7177
# Expose Odoo port
7278
EXPOSE 8069
73-
79+
CMD ["/odoo/openerp-server"]
7480
# Default command
7581
ENTRYPOINT ["/entrypoint.sh"]
7682
CMD ["openerp-server"]

0 commit comments

Comments
 (0)