-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit d511d39
Showing
15 changed files
with
1,677 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,62 @@ | ||
# Note: You can use any Debian/Ubuntu based image you want. | ||
FROM mcr.microsoft.com/vscode/devcontainers/base:0-buster | ||
|
||
# [Option] Install zsh | ||
ARG INSTALL_ZSH="true" | ||
# [Option] Upgrade OS packages to their latest versions | ||
ARG UPGRADE_PACKAGES="false" | ||
# [Option] Enable non-root Docker access in container | ||
ARG ENABLE_NONROOT_DOCKER="true" | ||
# [Option] Use the OSS Moby Engine instead of the licensed Docker Engine | ||
ARG USE_MOBY="true" | ||
|
||
# Install needed packages and setup non-root user. Use a separate RUN statement to add your | ||
# own dependencies. A user of "automatic" attempts to reuse an user ID if one already exists. | ||
ARG USERNAME=automatic | ||
ARG USER_UID=1000 | ||
ARG USER_GID=$USER_UID | ||
COPY library-scripts/*.sh /tmp/library-scripts/ | ||
RUN apt-get update \ | ||
&& /bin/bash /tmp/library-scripts/common-debian.sh "${INSTALL_ZSH}" "${USERNAME}" "${USER_UID}" "${USER_GID}" "${UPGRADE_PACKAGES}" \ | ||
# Use Docker script from script library to set things up | ||
&& /bin/bash /tmp/library-scripts/docker-debian.sh "${ENABLE_NONROOT_DOCKER}" "/var/run/docker-host.sock" "/var/run/docker.sock" "${USERNAME}" "${USE_MOBY}" \ | ||
# Clean up | ||
&& apt-get autoremove -y && apt-get clean -y && rm -rf /var/lib/apt/lists/* /tmp/library-scripts/ | ||
|
||
VOLUME [ "/var/lib/docker" ] | ||
|
||
# Setting the ENTRYPOINT to docker-init.sh will start up the Docker Engine | ||
# inside the container "overrideCommand": false is set in devcontainer.json. | ||
# The script will also execute CMD if you need to alter startup behaviors. | ||
ENTRYPOINT [ "/usr/local/share/docker-init.sh" ] | ||
CMD [ "sleep", "infinity" ] | ||
|
||
# [Optional] Uncomment this section to install additional OS packages. | ||
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \ | ||
&& apt-get -y install --no-install-recommends \ | ||
make build-essential libssl-dev zlib1g-dev \ | ||
libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm \ | ||
libncurses5-dev libncursesw5-dev xz-utils tk-dev \ | ||
libffi-dev \ | ||
libguestfs-dev \ | ||
linux-image-amd64 \ | ||
python3-parted | ||
|
||
# renovate: datasource=docker depName=python | ||
ARG PYTHON_VERSION=3.9.1 | ||
RUN curl -L -o /tmp/python.tgz https://www.python.org/ftp/python/${PYTHON_VERSION}/Python-${PYTHON_VERSION}.tgz && \ | ||
cd /tmp && \ | ||
tar xvf /tmp/python.tgz && \ | ||
cd Python-${PYTHON_VERSION} && \ | ||
./configure --with-ensurepip=install && \ | ||
make -j 8 && \ | ||
make install && \ | ||
cd && rm -rf /tmp/*ython* && \ | ||
cd /usr/local/bin \ | ||
&& ln -s idle3 idle \ | ||
&& ln -s pip3 pip \ | ||
&& ln -s pydoc3 pydoc \ | ||
&& ln -s python3 python \ | ||
&& ln -s python3-config python-config | ||
|
||
RUN pip install poetry |
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 |
---|---|---|
@@ -0,0 +1,35 @@ | ||
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at: | ||
// https://github.com/microsoft/vscode-dev-containers/tree/v0.155.1/containers/docker-from-docker | ||
{ | ||
"name": "Docker from Docker", | ||
"dockerFile": "Dockerfile", | ||
"runArgs": ["--init"], | ||
"mounts": [ "source=/var/run/docker.sock,target=/var/run/docker-host.sock,type=bind","type=bind,source=/tmp,target=/tmp" ], | ||
"overrideCommand": false, | ||
|
||
// Use this environment variable if you need to bind mount your local source code into a new container. | ||
"remoteEnv": { | ||
"LOCAL_WORKSPACE_FOLDER": "${localWorkspaceFolder}" | ||
}, | ||
|
||
// Set *default* container specific settings.json values on container create. | ||
"settings": { | ||
"terminal.integrated.shell.linux": "/bin/bash" | ||
}, | ||
|
||
// Add the IDs of extensions you want installed when the container is created. | ||
"extensions": [ | ||
"ms-azuretools.vscode-docker", | ||
"ms-python.vscode-pylance", | ||
"ms-python.python" | ||
], | ||
|
||
// Use 'forwardPorts' to make a list of ports inside the container available locally. | ||
// "forwardPorts": [], | ||
|
||
// Use 'postCreateCommand' to run commands after the container is created. | ||
// "postCreateCommand": "docker --version", | ||
|
||
// Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root. | ||
"remoteUser": "vscode" | ||
} |
Oops, something went wrong.