FROM ubuntu:16.04
MAINTAINER <NAME> <<EMAIL>>

# Build arguments
ARG RELEASE=devel
ARG VERSION="20.02.4"

# Get the image up to date and install utility tools
RUN apt-get -y update && \
    apt-get -y upgrade && \
    apt-get -y install bash-completion ca-certificates curl && \
    apt-get clean

WORKDIR /tmp

# Install oneclient package
RUN case ${RELEASE} in \
        production) \
            curl -O http://get.onedata.org/oneclient.sh; \
            ;; \
        *) \
            curl -O http://packages.devel.onedata.org/oneclient.sh; \
            ;; \
        esac && \
        sh oneclient.sh && \
        apt clean -y

RUN mkdir -p /run/docker/plugins /mnt/state /mnt/volumes /go/bin

COPY docker-volume-onedata /go/bin/docker-volume-onedata
RUN chmod 0775 /go/bin/docker-volume-onedata

CMD ["/go/bin/docker-volume-onedata"]
