Skip to content
Snippets Groups Projects
Dockerfile 3.06 KiB
Newer Older
Nicolas KAROLAK's avatar
Nicolas KAROLAK committed
FROM registry.ubicast.net/docker/debian-dev:latest
# avoid warnings by switching to noninteractive
ENV DEBIAN_FRONTEND noninteractive
# local pyvenv to avoid conflicts with system
ENV PYVENV ${HOME}/pyvenv
# go path
ENV GOPATH ${HOME}/go
# add pyvenv to path
ENV PATH ${GOPATH}/bin:${PYVENV}/bin:/usr/local/go/bin:${PATH}
RUN \
    # install required tools
    sudo apt-get update && \
    sudo apt-get install -y \
        libffi-dev \
        libncurses5 \
        libncursesw5 \
        libssl-dev \
        python3-netaddr \
    && \
    # clean up
    sudo apt-get autoremove -y && \
    sudo apt-get clean -y && \
    sudo rm -rf /var/lib/apt/lists/* &&  \
    # create pyvenv
Nicolas KAROLAK's avatar
Nicolas KAROLAK committed
    python3 -m venv --system-site-packages ${PYVENV} && \
    # update pip tools into pyvenv
    pip install -U \
        pip \
        wheel \
        && \
    # import hashicorp gpg key
    #sudo gpg --keyserver hkp://eu.pool.sks-keyservers.net --recv-key 51852D87348FFC4C && \
    sudo gpg --keyserver hkp://eu.pool.sks-keyservers.net --recv-key 72D7468F && \
Nicolas KAROLAK's avatar
Nicolas KAROLAK committed
ARG PACKER_VERSION=1.5.5
RUN \
    # packer
    sudo curl -LOSs https://releases.hashicorp.com/packer/${PACKER_VERSION}/packer_${PACKER_VERSION}_linux_amd64.zip && \
    sudo curl -LOSs https://releases.hashicorp.com/packer/${PACKER_VERSION}/packer_${PACKER_VERSION}_SHA256SUMS && \
    sudo curl -LOSs https://releases.hashicorp.com/packer/${PACKER_VERSION}/packer_${PACKER_VERSION}_SHA256SUMS.sig && \
    sudo gpg --verify packer_${PACKER_VERSION}_SHA256SUMS.sig packer_${PACKER_VERSION}_SHA256SUMS && \
    sudo shasum -a 256 -c packer_${PACKER_VERSION}_SHA256SUMS --ignore-missing && \
    sudo unzip -d /usr/local/bin packer_${PACKER_VERSION}_linux_amd64.zip && \
    sudo rm -f packer_${PACKER_VERSION}* && \
Nicolas KAROLAK's avatar
Nicolas KAROLAK committed
ARG GO_VERSION=1.14.1
    # golang
    sudo curl -LOSs https://dl.google.com/go/go${GO_VERSION}.linux-amd64.tar.gz && \
    sudo tar -C /usr/local/ -xzf go${GO_VERSION}.linux-amd64.tar.gz && \
    sudo rm -f go${GO_VERSION}* && \
    go get \
        github.com/mdempsky/gocode \
        github.com/uudashr/gopkgs/cmd/gopkgs \
        github.com/ramya-rao-a/go-outline \
        github.com/stamblerre/gocode \
        github.com/rogpeppe/godef \
        github.com/sqs/goreturns \
        golang.org/x/lint/golint \
Nicolas KAROLAK's avatar
Nicolas KAROLAK committed
    && \
COPY ansible/requirements.dev.txt .
RUN \
    # ansible & co
    pip install -r requirements.dev.txt && \
    sudo rm requirements.dev.txt && \
    :

Nicolas KAROLAK's avatar
Nicolas KAROLAK committed
ARG OVFTOOL_VERSION=4.4.0-15722219
ARG OVFTOOL_NAME=VMware-ovftool-${OVFTOOL_VERSION}-lin.x86_64
Stéphane Diemer's avatar
Stéphane Diemer committed
ARG OVFTOOL_URL=https://nextcloud.ubicast.net/s/6QfAyAgtmHmbrca/download?path=%2FVMware%20Tools&files=${OVFTOOL_NAME}
RUN \
    # ovf tool
    sudo curl -o ${OVFTOOL_NAME}.bundle -LSs "${OVFTOOL_URL}.bundle" && \
    sudo curl -o ${OVFTOOL_NAME}.sha256 -LSs "${OVFTOOL_URL}.sha256" && \
    sudo shasum -a 256 -c ${OVFTOOL_NAME}.sha256 --ignore-missing && \
    sudo sh ${OVFTOOL_NAME}.bundle -p /usr/local --console --required --eulas-agreed && \
    sudo rm ${OVFTOOL_NAME}.* && \
    :

# switch back to dialog for any ad-hoc use of apt-get
ENV DEBIAN_FRONTEND dialog