35 changed files with 372 additions and 2 deletions
@ -0,0 +1,5 @@ |
|||
{ |
|||
"registry-1.docker.io": { |
|||
"Seed": "K73vbuVEDOtCvIpjBAexOQ==" |
|||
} |
|||
} |
|||
@ -0,0 +1 @@ |
|||
ff9a8f4ec9f93f93 |
|||
@ -0,0 +1 @@ |
|||
2026-06-21T11:55:15Z |
|||
@ -0,0 +1 @@ |
|||
{"Key":"npipe:////./pipe/docker_engine","Name":"","Global":false} |
|||
@ -0,0 +1 @@ |
|||
{"Targets":["default"],"Refs":["o50poj56b489c14lapyb6cbmp","kjmy6s49acz1rv3g1c6h37ug9"]} |
|||
@ -0,0 +1 @@ |
|||
{"Targets":["default"],"Refs":["ij03t2w0kk3dmtak1enbhe5ej","totfwrcgcwsp003suc1ffykxc"]} |
|||
@ -0,0 +1 @@ |
|||
{"Targets":["default"],"Refs":["jdxewd9dkqe9dykn73zjxe1wr","b6km8htguq65azhdau5l1netr"]} |
|||
@ -0,0 +1 @@ |
|||
{"Target":"tera-web","LocalPath":"E:\\tera-clone\\target-bsp\\output\\backend-webapp-compose-smoke\\fet3568j-c\\20260621-204840\\docker-context\\web","DockerfilePath":"E:\\tera-clone\\target-bsp\\output\\backend-webapp-compose-smoke\\fet3568j-c\\20260621-204840\\docker-context\\web\\Dockerfile","GroupRef":"w9223d3305etoekws8vdlja83"} |
|||
@ -0,0 +1 @@ |
|||
{"Target":"default","LocalPath":"E:\\tera-clone\\docker\\forlinx-ok3568","DockerfilePath":""} |
|||
@ -0,0 +1 @@ |
|||
{"Target":"tera-web","LocalPath":"E:\\tera-clone\\target-bsp\\output\\backend-webapp-compose-smoke\\fet3568j-c\\20260621-205510\\docker-context\\web","DockerfilePath":"E:\\tera-clone\\target-bsp\\output\\backend-webapp-compose-smoke\\fet3568j-c\\20260621-205510\\docker-context\\web\\Dockerfile","GroupRef":"q2bw6zhatajxcxsgt3j3ik766"} |
|||
@ -0,0 +1 @@ |
|||
{"Target":"default","LocalPath":"E:\\tera-clone\\target-bsp\\output\\backend-runtime-smoke\\fet3568j-c\\20260621-182009\\docker-context","DockerfilePath":""} |
|||
@ -0,0 +1 @@ |
|||
{"Target":"tera-api","LocalPath":"E:\\tera-clone\\target-bsp\\output\\backend-webapp-compose-smoke\\fet3568j-c\\20260621-204840\\docker-context\\api","DockerfilePath":"E:\\tera-clone\\target-bsp\\output\\backend-webapp-compose-smoke\\fet3568j-c\\20260621-204840\\docker-context\\api\\Dockerfile","GroupRef":"w9223d3305etoekws8vdlja83"} |
|||
@ -0,0 +1 @@ |
|||
{"Target":"tera-web","LocalPath":"E:\\tera-clone\\target-bsp\\output\\backend-webapp-compose-smoke\\fet3568j-c\\20260621-204759\\docker-context\\web","DockerfilePath":"E:\\tera-clone\\target-bsp\\output\\backend-webapp-compose-smoke\\fet3568j-c\\20260621-204759\\docker-context\\web\\Dockerfile","GroupRef":"p04sc8qv9tuhvduacrzlgtscu"} |
|||
@ -0,0 +1 @@ |
|||
{"Target":"tera-api","LocalPath":"E:\\tera-clone\\target-bsp\\output\\backend-webapp-compose-smoke\\fet3568j-c\\20260621-204759\\docker-context\\api","DockerfilePath":"E:\\tera-clone\\target-bsp\\output\\backend-webapp-compose-smoke\\fet3568j-c\\20260621-204759\\docker-context\\api\\Dockerfile","GroupRef":"p04sc8qv9tuhvduacrzlgtscu"} |
|||
@ -0,0 +1 @@ |
|||
{"Target":"default","LocalPath":"E:\\tera-clone\\target-bsp\\output\\backend-runtime-smoke\\fet3568j-c\\20260621-182137\\docker-context","DockerfilePath":""} |
|||
@ -0,0 +1 @@ |
|||
{"Target":"default","LocalPath":"E:\\tera-clone\\docker\\forlinx-ok3568","DockerfilePath":""} |
|||
@ -0,0 +1 @@ |
|||
{"Target":"default","LocalPath":"E:\\tera-clone\\target-bsp\\output\\backend-runtime-smoke\\fet3568j-c\\20260621-182258\\docker-context","DockerfilePath":""} |
|||
@ -0,0 +1 @@ |
|||
{"Target":"default","LocalPath":"E:\\tera-clone\\target-bsp\\output\\backend-runtime-smoke\\fet3568j-c\\20260621-205504\\docker-context","DockerfilePath":""} |
|||
@ -0,0 +1 @@ |
|||
{"Target":"tera-api","LocalPath":"E:\\tera-clone\\target-bsp\\output\\backend-webapp-compose-smoke\\fet3568j-c\\20260621-205510\\docker-context\\api","DockerfilePath":"E:\\tera-clone\\target-bsp\\output\\backend-webapp-compose-smoke\\fet3568j-c\\20260621-205510\\docker-context\\api\\Dockerfile","GroupRef":"q2bw6zhatajxcxsgt3j3ik766"} |
|||
@ -0,0 +1 @@ |
|||
{"Target":"default","LocalPath":"E:\\tera-clone\\target-bsp\\output\\backend-runtime-smoke\\fet3568j-c\\20260621-190043\\docker-context","DockerfilePath":""} |
|||
@ -0,0 +1 @@ |
|||
{"Target":"default","LocalPath":"E:\\tera-clone\\target-bsp\\output\\backend-runtime-smoke\\fet3568j-c\\20260621-182056\\docker-context","DockerfilePath":""} |
|||
@ -0,0 +1 @@ |
|||
{"Target":"default","LocalPath":"E:\\tera-clone\\target-bsp\\output\\backend-runtime-smoke\\fet3568j-c\\20260621-182422\\docker-context","DockerfilePath":""} |
|||
@ -0,0 +1 @@ |
|||
{"Target":"default","LocalPath":"E:\\tera-clone\\docker\\forlinx-ok3568","DockerfilePath":""} |
|||
@ -0,0 +1 @@ |
|||
{"Target":"default","LocalPath":"E:\\tera-clone\\target-bsp\\output\\backend-runtime-smoke\\fet3568j-c\\20260621-182333\\docker-context","DockerfilePath":""} |
|||
@ -0,0 +1 @@ |
|||
2 |
|||
@ -1,3 +1,96 @@ |
|||
# docker |
|||
# OK3568 Docker Development Environment |
|||
|
|||
docker configuration |
|||
This folder contains the Docker-based replacement for the vendor VM described in |
|||
`docs/build/ok3568-multi-som-build-deploy-strategy.md`. |
|||
|
|||
## Scope |
|||
|
|||
- Host OS: Windows with Docker Desktop using Linux containers |
|||
- Container OS: Ubuntu 22.04 |
|||
- Container user: `forlinx` |
|||
- SDK mount: `/work/OK3568_Linux_fs` |
|||
- Vendor SDK source: |
|||
`bsp/OK3568-C&FET3568-C/OK3568-C&FET3568-C/OK3568-C&OK3568J-C&OK3568J-C21_Forlinx Desktop 22.04_R1/OS image and source code/1-Source_Code/OK3568_Linux_fs/OK3568_Linux_fs` |
|||
|
|||
The container is for build and packaging work. Keep Windows Rockchip tools |
|||
(`RKDevTool`, `FactoryTool`, `DriverAssitant`) as the default flashing path. |
|||
|
|||
## Docker Config Access |
|||
|
|||
If Docker reports that `C:\Users\<user>\.docker\config.json` is not accessible, |
|||
run the helper scripts below. They set `DOCKER_CONFIG` to `docker/.docker-config` |
|||
inside this repo. |
|||
|
|||
## Commands |
|||
|
|||
Check host prerequisites: |
|||
|
|||
```powershell |
|||
.\docker\scripts\check-host.ps1 |
|||
``` |
|||
|
|||
Build the image: |
|||
|
|||
```powershell |
|||
.\docker\scripts\build-image.ps1 |
|||
``` |
|||
|
|||
Open an interactive SDK shell: |
|||
|
|||
```powershell |
|||
.\docker\scripts\shell.ps1 |
|||
``` |
|||
|
|||
Run an SDK build target: |
|||
|
|||
```powershell |
|||
.\docker\scripts\build-source.ps1 -BuildTarget help |
|||
.\docker\scripts\build-source.ps1 -BuildTarget kernel |
|||
``` |
|||
|
|||
Multi-SoM target names are accepted by the wrapper for future use: |
|||
|
|||
```powershell |
|||
.\docker\scripts\build-source.ps1 -Target fet3568-c -BuildTarget kernel |
|||
``` |
|||
|
|||
The current vendor SDK still controls its active defconfig through its own |
|||
`output/.config` and `device/rockchip/.chip` links. The `-Target` value is |
|||
recorded in the container environment as `TERA_TARGET`, but target-specific |
|||
defconfig switching should be added only after the second SoM profile is known. |
|||
|
|||
## Direct Compose Usage |
|||
|
|||
```powershell |
|||
$env:DOCKER_CONFIG = "$PWD\docker\.docker-config" |
|||
docker compose -f docker\docker-compose.yml build ok3568-dev |
|||
docker compose -f docker\docker-compose.yml run --rm -e TERA_TARGET=fet3568-c ok3568-dev make help |
|||
``` |
|||
|
|||
## Notes |
|||
|
|||
- The SDK path includes spaces and `&`; use the provided compose file or scripts |
|||
instead of hand-typing long volume paths. |
|||
- The vendor SDK contains Windows-created symlinks at the source root. The |
|||
container entrypoint checks that `Makefile` and `build.sh` are readable before |
|||
running commands. |
|||
- Docker must be running before build or shell commands can execute. |
|||
|
|||
## Docker Desktop Virtualization Error |
|||
|
|||
If Docker Desktop reports: |
|||
|
|||
```text |
|||
Hardware assisted virtualization and data execution protection must be enabled in the BIOS |
|||
``` |
|||
|
|||
check these host settings: |
|||
|
|||
- BIOS/UEFI: enable Intel VT-x / Intel Virtualization Technology, or AMD-V / SVM. |
|||
- BIOS/UEFI: enable Execute Disable Bit / XD / NX / Data Execution Prevention. |
|||
- Windows features: enable Windows Subsystem for Linux, Virtual Machine Platform, |
|||
and, when available on the Windows edition, Hyper-V. |
|||
- Reboot after changing BIOS or Windows feature settings. |
|||
|
|||
Run `.\docker\scripts\check-host.ps1` from an elevated PowerShell prompt to see |
|||
the current Windows optional feature states. |
|||
|
|||
@ -0,0 +1,25 @@ |
|||
version: "3.8" |
|||
|
|||
services: |
|||
ok3568-dev: |
|||
build: |
|||
context: ./forlinx-ok3568 |
|||
image: tera/forlinx-ok3568-dev:ubuntu22.04 |
|||
container_name: tera-ok3568-dev |
|||
working_dir: /work/OK3568_Linux_fs |
|||
environment: |
|||
SDK_ROOT: /work/OK3568_Linux_fs |
|||
DEBIAN_FRONTEND: noninteractive |
|||
volumes: |
|||
- type: bind |
|||
source: ${TERA_SDK_HOST_PATH:-../bsp/OK3568-C&FET3568-C/OK3568-C&FET3568-C/OK3568-C&OK3568J-C&OK3568J-C21_Forlinx Desktop 22.04_R1/OS image and source code/1-Source_Code/OK3568_Linux_fs/OK3568_Linux_fs} |
|||
target: /work/OK3568_Linux_fs |
|||
- type: bind |
|||
source: ../output |
|||
target: /repo-output |
|||
- ok3568-ccache:/home/forlinx/.ccache |
|||
stdin_open: true |
|||
tty: true |
|||
|
|||
volumes: |
|||
ok3568-ccache: |
|||
@ -0,0 +1,105 @@ |
|||
FROM ubuntu:22.04 |
|||
|
|||
ARG USERNAME=forlinx |
|||
ARG USER_UID=1000 |
|||
ARG USER_GID=1000 |
|||
|
|||
ENV DEBIAN_FRONTEND=noninteractive |
|||
ENV SDK_ROOT=/work/OK3568_Linux_fs |
|||
ENV PATH="${SDK_ROOT}/prebuilts/gcc/linux-x86/aarch64/gcc-arm-10.3-2021.07-x86_64-aarch64-none-linux-gnu/bin:${SDK_ROOT}/prebuilts/gcc/linux-x86/arm/gcc-arm-10.3-2021.07-x86_64-arm-none-linux-gnueabihf/bin:${PATH}" |
|||
|
|||
RUN apt-get update && apt-get install -y --no-install-recommends \ |
|||
acl \ |
|||
autoconf \ |
|||
automake \ |
|||
bc \ |
|||
binutils \ |
|||
bison \ |
|||
bsdmainutils \ |
|||
build-essential \ |
|||
bzip2 \ |
|||
ca-certificates \ |
|||
ccache \ |
|||
chrpath \ |
|||
cmake \ |
|||
cpio \ |
|||
curl \ |
|||
device-tree-compiler \ |
|||
default-jdk \ |
|||
diffstat \ |
|||
dwarves \ |
|||
fakeroot \ |
|||
file \ |
|||
flex \ |
|||
g++-aarch64-linux-gnu \ |
|||
g++-arm-linux-gnueabihf \ |
|||
gcc-aarch64-linux-gnu \ |
|||
gcc-arm-linux-gnueabihf \ |
|||
git \ |
|||
gnupg \ |
|||
gperf \ |
|||
gawk \ |
|||
kmod \ |
|||
lib32stdc++6 \ |
|||
lib32z1 \ |
|||
libelf-dev \ |
|||
libgmp-dev \ |
|||
libglib2.0-dev \ |
|||
libmpc-dev \ |
|||
libmpfr-dev \ |
|||
libncurses-dev \ |
|||
libncurses5-dev \ |
|||
libncursesw5-dev \ |
|||
libssl-dev \ |
|||
libtool \ |
|||
libudev-dev \ |
|||
libusb-1.0-0-dev \ |
|||
libxml2-utils \ |
|||
locales \ |
|||
lz4 \ |
|||
lzop \ |
|||
make \ |
|||
maven \ |
|||
ninja-build \ |
|||
nodejs \ |
|||
npm \ |
|||
openssh-client \ |
|||
patch \ |
|||
python-is-python3 \ |
|||
python3 \ |
|||
python3-pip \ |
|||
python3-setuptools \ |
|||
python3-wheel \ |
|||
qemu-user-static \ |
|||
repo \ |
|||
rsync \ |
|||
sudo \ |
|||
swig \ |
|||
texinfo \ |
|||
unzip \ |
|||
u-boot-tools \ |
|||
vim-tiny \ |
|||
wget \ |
|||
xz-utils \ |
|||
zip \ |
|||
zstd \ |
|||
&& rm -rf /var/lib/apt/lists/* |
|||
|
|||
RUN locale-gen en_US.UTF-8 ko_KR.UTF-8 |
|||
ENV LANG=en_US.UTF-8 |
|||
ENV LANGUAGE=en_US:en |
|||
ENV LC_ALL=en_US.UTF-8 |
|||
|
|||
RUN groupadd --gid ${USER_GID} ${USERNAME} \ |
|||
&& useradd --uid ${USER_UID} --gid ${USER_GID} -m ${USERNAME} \ |
|||
&& echo "${USERNAME}:${USERNAME}" | chpasswd \ |
|||
&& echo "${USERNAME} ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/${USERNAME} \ |
|||
&& chmod 0440 /etc/sudoers.d/${USERNAME} |
|||
|
|||
COPY entrypoint.sh /usr/local/bin/ok3568-entrypoint |
|||
RUN chmod +x /usr/local/bin/ok3568-entrypoint |
|||
|
|||
USER ${USERNAME} |
|||
WORKDIR /work/OK3568_Linux_fs |
|||
ENTRYPOINT ["/usr/local/bin/ok3568-entrypoint"] |
|||
CMD ["/bin/bash"] |
|||
@ -0,0 +1,32 @@ |
|||
#!/usr/bin/env bash |
|||
set -euo pipefail |
|||
|
|||
SDK_ROOT="${SDK_ROOT:-/work/OK3568_Linux_fs}" |
|||
|
|||
if [ ! -d "$SDK_ROOT" ]; then |
|||
echo "SDK root not mounted: $SDK_ROOT" >&2 |
|||
exit 2 |
|||
fi |
|||
|
|||
if [ ! -r "$SDK_ROOT/device/rockchip/common/Makefile" ]; then |
|||
echo "Vendor SDK common Makefile is missing under $SDK_ROOT." >&2 |
|||
exit 2 |
|||
fi |
|||
|
|||
if [ ! -s "$SDK_ROOT/Makefile" ] && [ ! -L "$SDK_ROOT/Makefile" ]; then |
|||
echo "SDK root Makefile is not readable as a file or symlink." >&2 |
|||
echo "Expected it to resolve to device/rockchip/common/Makefile." >&2 |
|||
exit 2 |
|||
fi |
|||
|
|||
if [ ! -x "$SDK_ROOT/build.sh" ]; then |
|||
chmod +x "$SDK_ROOT/build.sh" 2>/dev/null || true |
|||
fi |
|||
|
|||
mkdir -p /home/forlinx/.ccache "$SDK_ROOT/output" |
|||
|
|||
export USE_CCACHE=1 |
|||
export CCACHE_DIR=/home/forlinx/.ccache |
|||
|
|||
cd "$SDK_ROOT" |
|||
exec "$@" |
|||
@ -0,0 +1,10 @@ |
|||
[CmdletBinding()] |
|||
param() |
|||
|
|||
$ErrorActionPreference = 'Stop' |
|||
$RepoRoot = Resolve-Path (Join-Path $PSScriptRoot '..\..') |
|||
$DockerConfig = Join-Path $RepoRoot 'docker\.docker-config' |
|||
New-Item -ItemType Directory -Force $DockerConfig | Out-Null |
|||
$env:DOCKER_CONFIG = $DockerConfig |
|||
|
|||
docker compose -f (Join-Path $RepoRoot 'docker\docker-compose.yml') build ok3568-dev |
|||
@ -0,0 +1,19 @@ |
|||
[CmdletBinding()] |
|||
param( |
|||
[string]$Target = 'fet3568-c', |
|||
[string]$BuildTarget = 'help', |
|||
[switch]$UseBuildScript |
|||
) |
|||
|
|||
$ErrorActionPreference = 'Stop' |
|||
$RepoRoot = Resolve-Path (Join-Path $PSScriptRoot '..\..') |
|||
$DockerConfig = Join-Path $RepoRoot 'docker\.docker-config' |
|||
New-Item -ItemType Directory -Force $DockerConfig | Out-Null |
|||
$env:DOCKER_CONFIG = $DockerConfig |
|||
$env:TERA_TARGET = $Target |
|||
|
|||
if ($UseBuildScript) { |
|||
docker compose -f (Join-Path $RepoRoot 'docker\docker-compose.yml') run --rm -e TERA_TARGET=$Target ok3568-dev ./build.sh $BuildTarget |
|||
} else { |
|||
docker compose -f (Join-Path $RepoRoot 'docker\docker-compose.yml') run --rm -e TERA_TARGET=$Target ok3568-dev make $BuildTarget |
|||
} |
|||
@ -0,0 +1,44 @@ |
|||
[CmdletBinding()] |
|||
param() |
|||
|
|||
$ErrorActionPreference = 'Continue' |
|||
|
|||
Write-Host '[host] CPU virtualization / DEP' |
|||
try { |
|||
Get-CimInstance Win32_Processor | |
|||
Select-Object Name, |
|||
VirtualizationFirmwareEnabled, |
|||
SecondLevelAddressTranslationExtensions, |
|||
DataExecutionPrevention_Available | |
|||
Format-Table -AutoSize |
|||
} catch { |
|||
Write-Warning "Unable to query CPU virtualization state: $($_.Exception.Message)" |
|||
} |
|||
|
|||
Write-Host '' |
|||
Write-Host '[host] Required Windows optional features' |
|||
$features = @( |
|||
'Microsoft-Windows-Subsystem-Linux', |
|||
'VirtualMachinePlatform', |
|||
'Microsoft-Hyper-V-All', |
|||
'HypervisorPlatform' |
|||
) |
|||
|
|||
foreach ($feature in $features) { |
|||
try { |
|||
Get-WindowsOptionalFeature -Online -FeatureName $feature | |
|||
Select-Object FeatureName,State | |
|||
Format-Table -AutoSize |
|||
} catch { |
|||
Write-Warning "Unable to query ${feature}. Run this script from an elevated PowerShell prompt to inspect Windows optional features." |
|||
} |
|||
} |
|||
|
|||
Write-Host '' |
|||
Write-Host '[host] Docker daemon' |
|||
$RepoRoot = Resolve-Path (Join-Path $PSScriptRoot '..\..') |
|||
$DockerConfig = Join-Path $RepoRoot 'docker\.docker-config' |
|||
New-Item -ItemType Directory -Force $DockerConfig | Out-Null |
|||
$env:DOCKER_CONFIG = $DockerConfig |
|||
|
|||
docker version |
|||
@ -0,0 +1,13 @@ |
|||
[CmdletBinding()] |
|||
param( |
|||
[string]$Target = 'fet3568-c' |
|||
) |
|||
|
|||
$ErrorActionPreference = 'Stop' |
|||
$RepoRoot = Resolve-Path (Join-Path $PSScriptRoot '..\..') |
|||
$DockerConfig = Join-Path $RepoRoot 'docker\.docker-config' |
|||
New-Item -ItemType Directory -Force $DockerConfig | Out-Null |
|||
$env:DOCKER_CONFIG = $DockerConfig |
|||
$env:TERA_TARGET = $Target |
|||
|
|||
docker compose -f (Join-Path $RepoRoot 'docker\docker-compose.yml') run --rm -e TERA_TARGET=$Target ok3568-dev /bin/bash |
|||
Loading…
Reference in new issue