Docker

sudo docker pull ubuntu:12.04
sudo docker run -rm -it ubuntu:12.04 /bin/bash

# Container command
sudo docker ps
sudo docker start <container id>
sudo docker stop <container id>
sudo docker rm  <container id>

# Image command
sudo docker images
sudo docker rmi  <image id>


Dockerfile

# ubuntu 12.04 64bit build server (need multiarch)
FROM ubuntu:12.04
RUN apt-get update -y && \
apt-get install -y apt-utils
RUN apt-get update -y && \
apt-get install -y build-essential
RUN apt-get update -y && \
apt-get install -y gcc-multilib g++-multilib
RUN apt-get update -y && \
apt-get install -y vim net-tools inetutils-ping
RUN apt-get update -y && \
apt-get install -y curl subversion git cmake unzip openjdk-7-jdk squashfs-tools valgrind pkg-config bash-completion \
gettext:i386 bison:i386 bc:i386 gawk:i386 autoconf libtool libssl-dev:i386 liblzo2-2:i386 libncurses-dev:i386 \
zlib1g-dev:i386 \
flex libnss3-tools:i386 uuid-dev:i386 \
perl python ruby \
openssh-server
RUN apt-get update -y && \
apt-get install -y language-pack-en-base
RUN apt-get update -y && \
apt-get install -y sudo

RUN locale-gen "ko_KR.UTF-8"
RUN dpkg-reconfigure locales
RUN mkdir /var/run/sshd
# User Account
RUN echo 'root:root' | chpasswd
RUN adduser --disabled-password --gecos '' $USER
RUN echo $USER:$USER | chpasswd
RUN sh -c "echo $USER 'ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers"
RUN sh -c "echo 'PATH=$PATH:.ls' >> /home/$USER/.bashrc"
EXPOSE 22

댓글