-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* update Dockerfile * poetry versionup * poetry update * poetry update * poetry update * requirements
- Loading branch information
1 parent
b4598b3
commit 7530994
Showing
5 changed files
with
796 additions
and
795 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,132 +1,118 @@ | ||
FROM ubuntu:20.04 as devcontainer | ||
|
||
RUN set -x \ | ||
&& sed -i.bak -r 's!(deb|deb-src) \S+!\1 mirror://mirrors.ubuntu.com/mirrors.txt!' /etc/apt/sources.list | ||
|
||
RUN set -x \ | ||
&& apt-get update \ | ||
&& apt-get install -y --no-install-recommends \ | ||
ca-certificates \ | ||
&& apt-get clean && rm -rf /var/cache/apt/archives/* /var/lib/apt/lists/* | ||
FROM ubuntu:22.04 as devcontainer | ||
|
||
# Install prerequisites | ||
RUN set -x \ | ||
&& export DEBIAN_FRONTEND=noninteractive \ | ||
&& apt-get update \ | ||
&& apt-get install -y --no-install-recommends \ | ||
gnupg2 \ | ||
software-properties-common \ | ||
language-pack-ja \ | ||
tzdata \ | ||
&& apt-get clean && rm -rf /var/cache/apt/archives/* /var/lib/apt/lists/* \ | ||
curl \ | ||
lsb-release \ | ||
&& apt-get -y clean \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
# Set locale & timezone | ||
RUN update-locale LANG=ja_JP.UTF-8 LANGUAGE=ja_JP:ja \ | ||
&& ln -sf /usr/share/zoneinfo/Asia/Tokyo /etc/localtime \ | ||
&& echo 'Asia/Tokyo' >/etc/timezone | ||
&& echo "Asia/Tokyo" > /etc/timezone | ||
|
||
# create vscode user | ||
RUN set -x \ | ||
&& apt-get update \ | ||
&& apt-get install -y --no-install-recommends \ | ||
sudo \ | ||
&& apt-get clean && rm -rf /var/cache/apt/archives/* /var/lib/apt/lists/* \ | ||
&& echo "vscode ALL=(ALL) NOPASSWD:ALL" >>/etc/sudoers.d/ALL \ | ||
&& groupadd \ | ||
--gid 5000 \ | ||
vscode \ | ||
&& useradd \ | ||
--uid 5000 \ | ||
--gid 5000 \ | ||
--home-dir /home/vscode \ | ||
--create-home \ | ||
--shell /bin/bash \ | ||
vscode | ||
ENV LANG ja_JP.UTF-8 | ||
ENV LC_ALL ja_JP.UTF-8 | ||
ENV LC_CTYPE ja_JP.UTF-8 | ||
|
||
# vscode extensions cache | ||
# https://code.visualstudio.com/docs/remote/containers-advanced#_avoiding-extension-reinstalls-on-container-rebuild | ||
# ミラーは遅いのが混じっているので好きなリポジトリに変更すべき | ||
RUN set -x \ | ||
&& mkdir -p /home/vscode/.vscode-server/extensions /home/vscode/.vscode-server-insiders \ | ||
&& chown -R vscode:vscode /home/vscode/.vscode-server /home/vscode/.vscode-server-insiders \ | ||
&& ln -s /home/vscode/.vscode-server/extensions /home/vscode/.vscode-server-insiders/extensions | ||
&& sed -i.bak -r 's!(deb|deb-src) \S+!\1 mirror://mirrors.ubuntu.com/mirrors.txt!' /etc/apt/sources.list | ||
|
||
# common tools | ||
# Install Ubuntu packages | ||
RUN set -x \ | ||
# Add repositories | ||
# for docker | ||
&& curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add - \ | ||
&& add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" \ | ||
# Install packages | ||
&& apt-get update \ | ||
&& apt-get install -y --no-install-recommends \ | ||
# docker | ||
docker-ce-cli \ | ||
# python | ||
python3.10-dev \ | ||
python3-pip \ | ||
# common tools | ||
bash-completion \ | ||
curl \ | ||
build-essential \ | ||
git \ | ||
gnupg2 \ | ||
iputils-ping \ | ||
jq \ | ||
less \ | ||
make \ | ||
net-tools \ | ||
openssh-client \ | ||
sudo \ | ||
tar \ | ||
time \ | ||
unzip \ | ||
vim \ | ||
wget \ | ||
xz-utils \ | ||
zip \ | ||
&& apt-get clean && rm -rf /var/cache/apt/archives/* /var/lib/apt/lists/* | ||
|
||
# docker | ||
RUN set -x \ | ||
&& apt-get update \ | ||
&& apt-get install -y --no-install-recommends \ | ||
apt-transport-https \ | ||
ca-certificates \ | ||
curl \ | ||
gnupg-agent \ | ||
software-properties-common \ | ||
&& curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add - \ | ||
&& add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" \ | ||
&& apt-get update \ | ||
&& apt-get install -y --no-install-recommends \ | ||
docker-ce-cli \ | ||
&& apt-get clean && rm -rf /var/cache/apt/archives/* /var/lib/apt/lists/* \ | ||
&& groupadd --gid 999 docker \ | ||
&& usermod -aG docker vscode | ||
&& apt-get -y clean \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
# docker compose | ||
ARG COMPOSE_VERSION=1.27.4 | ||
# 1系はさすがにバージョン古すぎ、docker compose自体オワコンなので推奨しない | ||
# 使用しない場合は、docker / docker-compose hack in devcontainerのところも変更が必要 | ||
# 2系はbash completionスクリプトが存在しないので修正が必要 | ||
ARG COMPOSE_VERSION=1.29.2 | ||
RUN set -x \ | ||
&& apt-get update \ | ||
&& apt-get install -y --no-install-recommends \ | ||
curl \ | ||
&& apt-get clean && rm -rf /var/cache/apt/archives/* /var/lib/apt/lists/* \ | ||
&& curl -fsSL "https://github.com/docker/compose/releases/download/${COMPOSE_VERSION}/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose \ | ||
&& chmod +x /usr/local/bin/docker-compose \ | ||
&& curl -fsSL -o /etc/bash_completion.d/docker-compose "https://raw.githubusercontent.com/docker/compose/${COMPOSE_VERSION}/contrib/completion/bash/docker-compose" | ||
|
||
# docker / docker-compose in devcontainer | ||
# docker / docker-compose hack in devcontainer | ||
RUN set -x \ | ||
&& mkdir -p /usr/local/devcontainer-tool/bin \ | ||
&& curl -fsSL -o /usr/local/devcontainer-tool/bin/docker https://github.com/thamaji/devcontainer-docker/releases/download/v1.0.2/docker \ | ||
&& curl -fsSL -o /usr/local/devcontainer-tool/bin/docker https://github.com/thamaji/devcontainer-docker/releases/download/v1.0.3/docker \ | ||
&& chmod +x /usr/local/devcontainer-tool/bin/docker \ | ||
&& curl -fsSL -o /usr/local/devcontainer-tool/bin/docker-compose https://github.com/thamaji/devcontainer-compose/releases/download/v1.0.3/docker-compose \ | ||
&& chmod +x /usr/local/devcontainer-tool/bin/docker-compose | ||
ENV PATH=/usr/local/devcontainer-tool/bin:${PATH} | ||
|
||
# python3.9 | ||
RUN set -x \ | ||
&& apt-get update \ | ||
&& apt-get install -y --no-install-recommends \ | ||
python3.9 \ | ||
python3.9-dev \ | ||
python3-pip \ | ||
&& apt-get clean && rm -rf /var/cache/apt/archives/* /var/lib/apt/lists/* \ | ||
&& ln -s $(which python3.9) /usr/local/bin/python | ||
ENV PIP_DEFAULT_TIMEOUT=100 | ||
# Python / pip | ||
RUN ln -s $(which python3.10) /usr/bin/python | ||
ENV PYTHONDONTWRITEBYTECODE=1 \ | ||
PIP_DEFAULT_TIMEOUT=100 \ | ||
PIP_NO_CACHE_DIR=on \ | ||
PIP_DISABLE_PIP_VERSION_CHECK=on | ||
|
||
# poetry | ||
RUN set -x \ | ||
&& python -m pip install -U pip setuptools \ | ||
&& pip install poetry \ | ||
&& sudo -u vscode -i poetry config virtualenvs.in-project true | ||
&& python -m pip install -U \ | ||
pip \ | ||
setuptools \ | ||
requests \ | ||
&& python -m pip install \ | ||
"poetry<1.4" | ||
|
||
# fix poetry issue (see: https://github.com/python-poetry/poetry/issues/221) | ||
RUN set -x \ | ||
&& apt-get update \ | ||
&& apt-get install -y --no-install-recommends \ | ||
language-pack-en \ | ||
&& apt-get clean && rm -rf /var/cache/apt/archives/* /var/lib/apt/lists/* | ||
ENV LC_ALL=C.UTF-8 | ||
# Add user / Grant sudo privileges | ||
RUN useradd -m -s /bin/bash -u 5000 -U vscode \ | ||
&& echo "vscode ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers.d/ALL \ | ||
&& groupadd --gid 999 docker \ | ||
&& usermod -aG docker vscode | ||
|
||
ADD entrypoint.sh /entrypoint.sh | ||
|
||
USER vscode | ||
|
||
ADD entrypoint.sh /entrypoint.sh | ||
ENTRYPOINT [ "bash", "-eux", "/entrypoint.sh" ] | ||
RUN poetry config virtualenvs.in-project true | ||
|
||
# vscode extensions cache | ||
# https://code.visualstudio.com/docs/remote/containers-advanced#_avoiding-extension-reinstalls-on-container-rebuild | ||
RUN set -x \ | ||
&& mkdir -p /home/vscode/.vscode-server/extensions /home/vscode/.vscode-server-insiders \ | ||
&& ln -s /home/vscode/.vscode-server/extensions /home/vscode/.vscode-server-insiders/extensions | ||
|
||
|
||
ENTRYPOINT [ "bash", "/entrypoint.sh" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
sphinx==5.3.0 | ||
pydata-sphinx-theme==0.11.0 | ||
sphinx==6.1.3 | ||
pydata-sphinx-theme==0.13.0rc4 | ||
|
||
|
Oops, something went wrong.