github.com/hernad/nomad@v1.6.112/scripts/release/Dockerfile (about) 1 # Copyright (c) HashiCorp, Inc. 2 # SPDX-License-Identifier: MPL-2.0 3 4 # Dockerfile for building nomad binaries 5 # that mimics Vagrant environment as far as required 6 # for building the scripts and running provision scripts 7 8 FROM ubuntu:18.04 9 10 RUN apt-get update; apt-get install -y \ 11 apt-transport-https \ 12 ca-certificates \ 13 curl \ 14 git \ 15 sudo \ 16 tree \ 17 unzip \ 18 wget 19 20 RUN useradd --create-home vagrant \ 21 && echo 'vagrant ALL = (ALL) NOPASSWD: ALL' >> /etc/sudoers 22 23 # install priv packages 24 COPY ./scripts/linux-priv-config.sh /tmp/scripts/linux-priv-config.sh 25 RUN /tmp/scripts/linux-priv-config.sh 26 27 COPY ./scripts/linux-priv-go.sh /tmp/scripts/linux-priv-go.sh 28 RUN /tmp/scripts/linux-priv-go.sh 29 30 COPY ./scripts/vagrant-linux-priv-buf.sh /tmp/scripts/vagrant-linux-priv-buf.sh 31 RUN /tmp/scripts/vagrant-linux-priv-buf.sh 32 33 USER vagrant 34 35 COPY ./scripts/vagrant-linux-unpriv-ui.sh /tmp/scripts/vagrant-linux-unpriv-ui.sh 36 RUN /tmp/scripts/vagrant-linux-unpriv-ui.sh 37 # avoid requiring loading nvm.sh by using a well defined path as an alias to the node version 38 RUN /bin/bash -c '. ~/.nvm/nvm.sh && ln -s ~/.nvm/versions/node/$(nvm current) ~/.nvm/versions/node/.default' 39 40 COPY ./scripts/release/docker-build-all /tmp/scripts/docker-build-all 41 42 # Update PATH with GO bin, yarn, and node 43 ENV GOPATH="/opt/gopath" \ 44 PATH="/home/vagrant/.nvm/versions/node/.default/bin:/home/vagrant/bin:/opt/gopath/bin:/home/vagrant/.yarn/bin:/home/vagrant/.config/yarn/global/node_modules/.bin:$PATH" 45 46 RUN mkdir -p /opt/gopath/src/github.com/hernad/nomad 47 RUN mkdir -p /home/vagrant/bin \ 48 && mkdir -p /home/vagrant/bin /home/vagrant/.ssh \ 49 && git config --global user.email "nomad@hashicorp.com" \ 50 && git config --global user.name "Nomad Release Bot" 51 52 ## Prepare vagrant user for private github.com deps fetching 53 RUN git config --global url."ssh://git@github.com".insteadOf "https://github.com" || true 54 RUN echo 'github.com ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAq2A7hRGmdnm9tUDbO9IDSwBK6TbQa+PXYPCPy6rbTrTtw7PHkccKrpp0yVhp5HdEIcKr6pLlVDBfOLX9QUsyCOV0wzfjIJNlGEYsdlLJizHhbn2mUjvSAHQqZETYP81eFzLQNnPHt4EVVUh7VfDESU84KezmD5QlWpXLmvU31/yMf+Se8xhHTvKSCZIFImWwoG6mbUoWf9nzpIoaSjB+weqqUUmpaaasXVal72J+UX2B+2RPW3RcT0eOzQgqlJL3RKrTJvdsjE3JEAvGq3lGHSZXy28G3skua2SmVi/w4yCE6gbODqnTWlg7+wC604ydGXA8VJiS5ap43JXiUFFAaQ==' > /home/vagrant/.ssh/known_hosts 55 56 ARG SSH_KEY 57 RUN echo "$SSH_KEY" > /home/vagrant/.ssh/id_rsa \ 58 && chmod 600 /home/vagrant/.ssh/id_rsa