Skip to content

Commit

Permalink
allow sudo without pw in dockerfile
Browse files Browse the repository at this point in the history
Co-authored-by: Seth Boyles <[email protected]>
Co-authored-by: Marc Paquette <[email protected]>
  • Loading branch information
sethboyles and MarcPaquette committed Apr 9, 2021
1 parent d388a68 commit 6581ae0
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions capi-workspace-docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -40,22 +40,25 @@ RUN service mysql start && \
echo 'mysql-server mysql-server/root_password_again password password' | debconf-set-selections

#Install Credhub CLI
RUN mkdir tmp -p && \
cd tmp && \
RUN mkdir /tmp/credhub -p && \
cd /tmp/credhub && \
wget https://github.com/cloudfoundry-incubator/credhub-cli/releases/download/2.9.0/credhub-linux-2.9.0.tgz && \
tar xf credhub*tgz && \
chmod +x credhub && \
mv credhub /usr/bin && \
cd .. && \
rm -rf tmp
cd / && \
rm -rf /tmp/credhub

RUN service ssh restart

#Install Bosh CLI

RUN wget https://github.com/cloudfoundry/bosh-cli/releases/download/v6.4.1/bosh-cli-6.4.1-linux-amd64 && \
mv bosh-cli-6.4.1-linux-amd64 /usr/bin/bosh && \
chmod +x /usr/bin/bosh

# Capi user section
RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers

RUN useradd -rm -d /home/capi -s /bin/bash -g root -G sudo -u 1001 capi -p capi
USER capi
WORKDIR /home/capi
Expand Down

0 comments on commit 6581ae0

Please sign in to comment.