diff --git a/repository-containers/github.com/tensorflow/tensorflow/.devcontainer/Dockerfile b/repository-containers/github.com/tensorflow/tensorflow/.devcontainer/Dockerfile new file mode 100644 index 0000000000..48a53749c4 --- /dev/null +++ b/repository-containers/github.com/tensorflow/tensorflow/.devcontainer/Dockerfile @@ -0,0 +1,42 @@ +#------------------------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See https://go.microsoft.com/fwlink/?linkid=2090316 for license information. +#------------------------------------------------------------------------------------------------------------- +ARG IMAGE_TYPE +FROM tensorflow/tensorflow:devel$IMAGE_TYPE + +# This Dockerfile adds a non-root user with sudo access. Use the "remoteUser" +# property in devcontainer.json to use it. On Linux, the container user's GID/UIDs +# will be updated to match your local UID/GID (when using the dockerFile property). +# See https://aka.ms/vscode-remote/containers/non-root-user for details. +ARG USERNAME=vscode +ARG USER_UID=1000 +ARG USER_GID=$USER_UID + +# Options for common package install script - SHA updated on release +ARG INSTALL_ZSH="false" +ARG UPGRADE_PACKAGES="false" +ARG COMMON_SCRIPT_SOURCE="https://raw.githubusercontent.com/microsoft/vscode-dev-containers/master/script-library/common-debian.sh" +ARG COMMON_SCRIPT_SHA="dev-mode" + +# Configure apt and install packages +RUN apt-get update \ + && export DEBIAN_FRONTEND=noninteractive \ + # + # Verify git, common tools / libs installed, add/modify non-root user, optionally install zsh + && apt-get -y install --no-install-recommends curl ca-certificates 2>&1 \ + && curl -sSL ${COMMON_SCRIPT_SOURCE} -o /tmp/common-setup.sh \ + && ([ "${COMMON_SCRIPT_SHA}" = "dev-mode" ] || (echo "${COMMON_SCRIPT_SHA} */tmp/common-setup.sh" | sha256sum -c -)) \ + && /bin/bash /tmp/common-setup.sh "${INSTALL_ZSH}" "${USERNAME}" "${USER_UID}" "${USER_GID}" "${UPGRADE_PACKAGES}" \ + && rm /tmp/common-setup.sh \ + # + # ********************************************************************* + # * Uncomment this section to use RUN to install other dependencies. * + # * See https://aka.ms/vscode-remote/containers/dockerfile-run * + # ********************************************************************* + # && apt-get -y install --no-install-recommends + # + # Clean up + && apt-get autoremove -y \ + && apt-get clean -y \ + && rm -rf /var/lib/apt/lists/* \ No newline at end of file diff --git a/repository-containers/github.com/tensorflow/tensorflow/.devcontainer/devcontainer.json b/repository-containers/github.com/tensorflow/tensorflow/.devcontainer/devcontainer.json new file mode 100644 index 0000000000..a6a813e11e --- /dev/null +++ b/repository-containers/github.com/tensorflow/tensorflow/.devcontainer/devcontainer.json @@ -0,0 +1,56 @@ +{ + "name": "Tensorflow Dev Container", + + "dockerFile": "Dockerfile", + + // Uncomment this for GPU image + // "build": { + // "args": { + // "IMAGE_TYPE": "-gpu" + // } + // }, + + + // Set *default* container specific settings.json values on container create. + "settings": { + "terminal.integrated.shell.linux": "/bin/bash", + "python.testing.pytestEnabled": true, + "python.testing.pytestArgs": [ + "./tensorflow" + ], + "C_Cpp.clang_format_style": "{BasedOnStyle: Google}", + "C_Cpp.default.includePath": [ + "${workspaceFolder}/**", + ], + "files.watcherExclude": { + "**/bazel-*/**": true + }, + "search.exclude": { + "**/bazel-*/**": true + } + }, + + // Add the IDs of extensions you want installed when the container is created. + "extensions": [ + "ms-python.python", + "ms-vscode.cpptools", + ], + + // 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": "uname -a", + "mounts": [ + "source=tensorflow_cache,target=/home/vscode/.cache/bazel/" + ], + + // Uncomment when using a ptrace-based debugger like C++, Go, and Rust + "runArgs": [ + "--cap-add=SYS_PTRACE", + // Uncomment this to enable Nvidia support + //"--runtime=nvidia", + "--security-opt", + "seccomp=unconfined" ], + "remoteUser": "vscode" +}