Hi, everyone!
I am migrating our .NET 6.0 app, which was done with the v1 extension using the provided template. I have successfully install the new extension following this documentation
.NET Core Application Development on Visual Studio Code | Toradex Developer Center
I was able to debug and deploy the application without any major problems. for the moment I modified the docker file, docker-compose add all the nugets package and all the package needed for the app.
The problem comes with the display environment variable, it seen the windows forms don’t find the display variable. as i say in the version V1 of the extension this variable it sent as environment variable using:
env ENV DISPLAY=:0
At the moment, when sending the variable, it is not respected by the container, since when using docker inspect CONTAINER ID --format "{{.Config.Evn}}"
ls variable is not displayed correctly
I would like to know what I am missing; this is the docker file I am using
# ARGUMENTS --------------------------------------------------------------------
##
# Board architecture
##
ARG IMAGE_ARCH=
##
# Base container version
##
ARG BASE_VERSION=3-6.0
##
# Application Name
##
ARG APP_EXECUTABLE=t1
# ARGUMENTS --------------------------------------------------------------------
# BUILD ------------------------------------------------------------------------
FROM mcr.microsoft.com/dotnet/sdk:6.0 AS Build
ARG IMAGE_ARCH
ARG APP_EXECUTABLE
COPY . /build
WORKDIR /build
# build
RUN dotnet restore && \
dotnet publish -c Release -r linux-${IMAGE_ARCH} --no-self-contained
# BUILD ------------------------------------------------------------------------
# DEPLOY -----------------------------------------------------------------------
FROM --platform=linux/${IMAGE_ARCH} \
torizon/dotnet:${BASE_VERSION} AS Deploy
ARG IMAGE_ARCH
ARG APP_EXECUTABLE
ENV APP_EXECUTABLE ${APP_EXECUTABLE} DISPLAY=:0
RUN apt-get -y update && apt-get install -y --no-install-recommends \
# ADD YOUR PACKAGES HERE
# DO NOT REMOVE THIS LABEL: this is used for VS Code automation
# __torizon_packages_prod_start__
alsa-utils:arm64 \
libasound2:arm64 \
libgpiod-dev:arm64 \
tzdata-bookworm:arm64 \
libx11-dev:arm64 \
libgdiplus:arm64 \
# __torizon_packages_prod_end__
# DO NOT REMOVE THIS LABEL: this is used for VS Code automation
&& apt-get clean && apt-get autoremove && rm -rf /var/lib/apt/lists/*
# copy the build
COPY --from=Build /build/bin/Release/net6.0/linux-${IMAGE_ARCH}/publish /app
# ADD YOUR ARGUMENTS HERE
CMD [ "./app/t1" ]
# DEPLOY -----------------------------------------------------------------------
and the docker-compose
version: "3.9"
services:
t1-debug:
build:
context: .
dockerfile: Dockerfile.debug
depends_on:
- weston
image: ${LOCAL_REGISTRY}:5002/t1-debug:${TAG}
environment:
- DISPLAY=:0
network_mode: host
devices:
- '/dev/gpiochip2'
- '/dev/gpiochip4'
- '/dev/snd'
- '/dev/verdin-uart1'
- '/dev/verdin-uart2'
volumes:
- type: bind
source: /tmp
target: /tmp
- type: bind
source: /dev
target: /dev
- type: bind
source: /dev/disk/by-label/otaroot
target: /dev/disk/by-label/otaroot
- type: bind
source: /dev/dri
target: /dev/dri
- type: bind
source: /etc/localtime
target: /etc/localtime
- type: bind
source: /etc/timezone
target: /etc/timezone
- type: bind
source: /home/torizon/fonts
target: /usr/share/fonts/truetype/
- type: bind
source: /home/torizon/lx7
target: /home/torizon/lx7
- type: bind
source: /var/run/dbus
target: /var/run/dbus
device_cgroup_rules:
# ... for tty0
- "c 4:0 rmw"
# ... for tty7
- "c 4:7 rmw"
# ... for /dev/input devices
- "c 13:* rmw"
- "c 199:* rmw"
# ... for /dev/dri devices
- "c 226:* rmw"
ports:
- 2222:2222
t1:
build:
context: .
dockerfile: Dockerfile
image: ${DOCKER_LOGIN}/t1:${TAG}
# TODO: we are using bullseye here because an issue with xwayland on bookworm
weston:
image: torizon/weston-vivante:3
environment:
- ACCEPT_FSL_EULA=1
# Required to get udev events from host udevd via netlink
network_mode: host
volumes:
- type: bind
source: /tmp
target: /tmp
- type: bind
source: /dev
target: /dev
- type: bind
source: /run/udev
target: /run/udev
cap_add:
- CAP_SYS_TTY_CONFIG
# Add device access rights through cgroup...
device_cgroup_rules:
# ... for tty0
- "c 4:0 rmw"
# ... for tty1
- "c 4:1 rmw"
# ... for tty7
- "c 4:7 rmw"
# ... for /dev/input devices
- "c 13:* rmw"
- "c 199:* rmw"
# ... for /dev/dri devices
- "c 226:* rmw"