-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
72 lines (57 loc) · 2.4 KB
/
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
##############################################################################
#
# Copyright (C) 2017-2019 Dr Adam S. Candy.
#
# Contact: Dr Adam S. Candy, [email protected]
#
# This file is part of the CaribbeanWatch project.
#
# Please see the AUTHORS file in the main source directory for a full list
# of contributors.
#
# CaribbeanWatch is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# CaribbeanWatch is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with CaribbeanWatch. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
# Use a Xenial base image
FROM ubuntu:bionic
# This DockerFile is looked after by
MAINTAINER Adam Candy <[email protected]>
# Ensure we are asked no questions for installs
ARG DEBIAN_FRONTEND=noninteractive
# Install required packages
RUN apt-get update && apt-get install -y \
python3-pip \
python3-netcdf4
# Select Python3 as the default
RUN update-alternatives --install /usr/bin/python python /usr/bin/python3 1
# Upgrade pip
RUN pip3 install -i https://pypi.python.org/simple/ --upgrade pip setuptools
# Install motuclient
RUN python3 -m pip install motuclient==1.8.4
# Patch motuclient to give us the reply from the CMEMS API at least
RUN sed -i -e "s/\(motu_reply=m.read()\)/\1; print('MOTU_REPLY'); print(motu_reply); print(' ')/" /usr/local/lib/python3.6/dist-packages/motu_utils/motu_api.py
# Add a user
RUN adduser --disabled-password --gecos "" motutest
# Switch user
USER motutest
WORKDIR /home/motutest
# Copy over files needed for the test
COPY --chown=motutest:motutest cmems_secret.py /home/motutest/
COPY --chown=motutest:motutest test.sh /home/motutest/
# Provide some information about the environment
RUN echo "DEBUGASC"
RUN python3 --version
RUN python3 -m motuclient --version
RUN python3 -c "import ssl; print(ssl.OPENSSL_VERSION)"
RUN python3 -v -c "import motuclient" 2>&1 | grep motuclient