Skip to content

Commit

Permalink
chore: update vscode dev container config (#769)
Browse files Browse the repository at this point in the history
  • Loading branch information
overcat committed Aug 27, 2023
1 parent d4f5e9f commit 9376d98
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 45 deletions.
17 changes: 4 additions & 13 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ubuntu:focal
FROM ubuntu:jammy

# This Dockerfile adds a non-root 'vscode' user with sudo access. However, for Linux,
# this user's GID/UID must match your local user UID/GID to avoid permission issues
Expand All @@ -20,20 +20,11 @@ RUN apt-get update && apt-get upgrade -qy && apt-get install -qy \
make \
python-is-python3 \
python3 \
python3-pip \
ruby \
fish && \
python3-pip && \
apt-get autoclean -y && \
apt-get autoremove -y && \
apt-get clean

# Install xdrgen
RUN cd /opt && \
git clone --branch python-sdk https://github.com/overcat/xdrgen && \
cd xdrgen && \
gem build xdrgen.gemspec && \
gem install xdrgen-*.gem

# Install poetry
RUN pip install poetry

Expand All @@ -46,7 +37,7 @@ ENV LC_ALL en_US.UTF-8

# Create a non-root user to use if preferred - see https://aka.ms/vscode-remote/containers/non-root-user.
RUN groupadd --gid $USER_GID $USERNAME \
&& useradd -s /bin/fish --uid $USER_UID --gid $USER_GID -m $USERNAME \
&& useradd --uid $USER_UID --gid $USER_GID -m $USERNAME \
# [Optional] Add sudo support for the non-root user
&& apt-get install -y sudo \
&& echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME\
Expand All @@ -57,4 +48,4 @@ ENV DEBIAN_FRONTEND=

USER $USERNAME

CMD ["/bin/fish"]
CMD ["/bin/bash"]
41 changes: 9 additions & 32 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// For format details, see https://aka.ms/vscode-remote/devcontainer.json or the definition README at
// https://github.com/microsoft/vscode-dev-containers/tree/master/containers/ubuntu-18.04-git
// For format details, see https://aka.ms/vscode-remote/devcontainer.json
{
"name": "Stellar Python SDK Dev",
"name": "python dev",
"dockerFile": "Dockerfile",
"build": {
"args": {}
Expand All @@ -10,37 +9,15 @@
"remoteEnv": {
// "PIP_INDEX_URL": "https://mirrors.ustc.edu.cn/pypi/web/simple"
},
// The optional 'runArgs' property can be used to specify additional runtime arguments.
"runArgs": [],
// Use 'settings' to set *default* container specific settings.json values on container create.
// You can edit these settings after create using File > Preferences > Settings > Remote.
"settings": {
"terminal.integrated.profiles.linux": {
"bash": {
"path": "/bin/bash"
},
"fish": {
"path": "/bin/fish"
}
},
"terminal.integrated.defaultProfile.linux": "fish"
"customizations": {
"vscode": {
"extensions": [
"ms-python.python"
]
}
},
// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [3000],
// Use 'portsAttributes' to set default properties for specific forwarded ports. More info: https://code.visualstudio.com/docs/remote/devcontainerjson-reference.
// "portsAttributes": {
// },
// Use 'otherPortsAttributes' to configure any ports that aren't configured using 'portsAttributes'.
// "otherPortsAttributes": {
// "onAutoForward": "silent"
// },
// Uncomment the next line to run commands after the container is created.
"postCreateCommand": "poetry install",
"postCreateCommand": "poetry install --all-extras",
"postAttachCommand": "poetry shell",
// Add the IDs of extensions you want installed when the container is created in the array below.
"extensions": ["donjayamanne.python-extension-pack"],
// Comment out to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
// On Linux, this will prevent new files getting created as root, but you may need to update the USER_UID
// and USER_GID in .devcontainer/Dockerfile to match your user if not 1000.
"remoteUser": "vscode"
}

0 comments on commit 9376d98

Please sign in to comment.