V Development Environment

DockerでUbuntu18.04上にV開発環境を構築

Dockerfile

FROM ubuntu:18.04

# configure root user
RUN echo 'root:root' | chpasswd

# configure development user
ARG user=me
RUN groupadd ${user} && \
 useradd -g ${user} -m ${user} -s /bin/bash && \
 echo "${user}:${user}" | chpasswd

# install essentials
RUN apt update && apt -y upgrade && \
 apt -y install vim less wget curl zip make git && \
 apt clean

# install V Development environment
RUN apt -y install gcc && \
 cd /tmp && \
 git clone https://github.com/vlang/v && \
 cd v && \
 make && \
 make install && \
 cd /tmp && \
 rm -rf v

イメージビルド

docker image build -f ./Dockerfile -t ubuntu18.04:dev_v .

コンテナ生成&起動

docker container run -i -t --rm ubuntu18.04:dev_v su - me

ホストをマウントする場合

docker container run -i -t --rm \
--mount type=bind,src=/Users/me/code,dst=/home/me/code \
ubuntu18.04:dev_v su - me

Swift Development Environment

DockerでUbuntu18.04上にSwift開発環境を構築

Dockerfile

FROM ubuntu:18.04

# configure root user
RUN echo 'root:root' | chpasswd

# configure development user
ARG user=me
RUN groupadd ${user} && \
 useradd -g ${user} -m ${user} -s /bin/bash && \
 echo "${user}:${user}" | chpasswd

# install essentials
RUN apt update && apt -y upgrade && \
 apt -y install vim less wget curl zip make git && \
 apt clean

# install Swift Development environment
ARG swift_version=swift-5.0.2
RUN apt -y install clang && \
 cd /opt && \
 curl -SL https://swift.org/builds/${swift_version}-release/ubuntu1804/${swift_version}-RELEASE/${swift_version}-RELEASE-ubuntu18.04.tar.gz | tar xz && \
 echo "export PATH=/opt/${swift_version}-RELEASE-ubuntu18.04/usr/bin:${PATH}" >> /home/${user}/.bashrc

イメージビルド

docker image build -f ./Dockerfile -t ubuntu18.04:dev_swift .

コンテナ生成&起動

docker container run -i -t --rm ubuntu18.04:dev_swift su - me

ホストをマウントする場合

docker container run -i -t --rm \
--mount type=bind,src=/Users/me/code,dst=/home/me/code \
ubuntu18.04:dev_swift su - me

Scala Development Environment

DockerでCentOS7上にScala開発環境を構築

Dockerfile

FROM centos:7

# configure root user
RUN echo 'root:root' | chpasswd

# configure development user
ARG user=me
RUN groupadd ${user} && \
 useradd -g ${user} -m ${user} -s /bin/bash && \
 echo "${user}:${user}" | chpasswd

# install essentials
RUN yum -y update && \
 yum -y install vim less wget zip unzip make git && \
 yum clean all

# install Scala Development environment
RUN yum -y install java-1.8.0-openjdk-devel.i686 which && \
 su - -c "curl -s get.sdkman.io | bash && source ~/.sdkman/bin/sdkman-init.sh && sdk install scala" ${user}

イメージビルド

docker image build -f ./Dockerfile -t centos7:dev_scala .

コンテナ生成&起動

docker container run -i -t --rm centos7:dev_scala su - me

ホストをマウントする場合

docker container run -i -t --rm \
--mount type=bind,src=/Users/me/code,dst=/home/me/code \
centos7:dev_scala su - me

DockerでUbuntu18.04上にScala開発環境を構築

Dockerfile

FROM ubuntu:18.04

# configure root user
RUN echo 'root:root' | chpasswd

# configure development user
ARG user=me
RUN groupadd ${user} && \
 useradd -g ${user} -m ${user} -s /bin/bash && \
 echo "${user}:${user}" | chpasswd

# install essentials
RUN apt update && apt -y upgrade && \
 apt -y install vim less wget curl zip make git && \
 apt clean

# install Scala Development environment
RUN apt -y install default-jdk && \
 su - -c "curl -s get.sdkman.io | bash && source ~/.sdkman/bin/sdkman-init.sh && sdk install scala" ${user}

イメージビルド

docker image build -f ./Dockerfile -t ubuntu18.04:dev_scala .

コンテナ生成&起動

docker container run -i -t --rm ubuntu18.04:dev_scala su - me

ホストをマウントする場合

docker container run -i -t --rm \
--mount type=bind,src=/Users/me/code,dst=/home/me/code \
ubuntu18.04:dev_scala su - me