Skip to content

Instantly share code, notes, and snippets.

@iganari
Created January 27, 2017 06:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save iganari/621ecb2cf93e700bac5eb21a802636d8 to your computer and use it in GitHub Desktop.
Save iganari/621ecb2cf93e700bac5eb21a802636d8 to your computer and use it in GitHub Desktop.
FROM ubuntu:16.04
MAINTAINER iganari <iganari@qiita.com>
# apt update
RUN apt-get update
RUN apt-get install -y sudo
# add sudo user
RUN groupadd -g 1000 developer && \
useradd -g developer -G sudo -m -s /bin/bash iganari && \
echo 'iganari:hogehoge' | chpasswd
RUN echo 'Defaults visiblepw' >> /etc/sudoers
RUN echo 'iganari ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
USER iganari
@iganari
Copy link
Author

iganari commented Jan 27, 2017

  • 実行コマンド
# docker build --no-cache .
# docker tag $(docker images -q | head -1) sudo-test
# docker run --rm -it sudo-test /bin/bash

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment