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