Skip to content

Commit

Permalink
Devcontainer environment support
Browse files Browse the repository at this point in the history
create devcontainer configuration which installs required petalinux package and call setup script.
  • Loading branch information
pbk20191 committed Apr 9, 2024
1 parent 8687408 commit 0c0aa8f
Show file tree
Hide file tree
Showing 2 changed files with 74 additions and 0 deletions.
27 changes: 27 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
FROM mcr.microsoft.com/devcontainers/base:focal
RUN dpkg --add-architecture i386
RUN \
apt update && \
apt install -y \
libxtst6 libx11-6 libtinfo-dev libxrender-dev libfreetype6 libxi6

RUN \
apt install -y \
libncurses5 wget git xterm \
libncurses5-dev libncursesw5-dev \
lib32ncurses6 autoconf libtool\
texinfo gcc-multilib nano
RUN locale-gen en_US.utf8 && update-locale
RUN \
apt install -y \
software-properties-common lsb-core
WORKDIR /tmp/work
COPY ./sdbuild/scripts/setup_host.sh .
RUN chmod +x setup_host.sh
RUN /bin/sh -c /tmp/work/setup_host.sh
RUN rm -r /tmp/work/*
LABEL reference="https://superuser.com/questions/715722/how-to-do-dpkg-reconfigure-dash-as-bash-automatically"
RUN echo "dash dash/sh boolean false" | debconf-set-selections
RUN DEBIAN_FRONTEND=noninteractive dpkg-reconfigure dash

WORKDIR /workspace
47 changes: 47 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/ubuntu
{
"name": "Ubuntu",
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
// "image": "mcr.microsoft.com/devcontainers/base:focal",
"build" : {
"context": "..",
"dockerfile": "Dockerfile"
},

"features": {
// "ghcr.io/devcontainers-contrib/features/apt-get-packages:1": {
// "clean_ppas": true,
// "preserve_apt_list": true,
// "packages": "build-essential",
// "ppas": "ppa:deadsnakes/ppa"
// },
// "ghcr.io/devcontainers-contrib/features/apt-packages:1": {
// "clean_ppas": true,
// "preserve_apt_list": true,
// "packages": "build-essential",
// "ppas": "ppa:deadsnakes/ppa"
// },
// "ghcr.io/devcontainers-contrib/features/wget-apt-get:1": {}
},

// Features to add to the dev container. More info: https://containers.dev/features.
// "features": {},

// 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",

// Configure tool-specific properties.
// "customizations": {},

"privileged": true,
// "capAdd": ["SYS_ADMIN"],
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
// "remoteUser": "root"
"mounts": [
"source=/tools/Xilinx,target=/tools/Xilinx,readonly,type=bind,consistency=cached"
]
}

0 comments on commit 0c0aa8f

Please sign in to comment.