Skip to content

Docker Image Generation for Petalinux, updated for Petalinux 2024.1

License

Notifications You must be signed in to change notification settings

tompacino/docker-petalinux-2024.1

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Petalinux 2024.1 Dockerfile

This is a fork of docker-petalinux by Matthieu Labas. I have updated it to work with Petalinux 2024.1. In short, the following changes were made:

  • XILVER changed to 2024.1
  • Base image changed to ubuntu:22.04
  • Universe repository source added and several new packages added required for 2024.1 release. Please note that some packages may be unnecessary and may have been erronously added when I was debugging/testing
  • License skip command line argument changed for 2024.1
  • Default shell in the docker image set to /bin/bash as required by petalinux
  • Default docker container name changed in petalin.sh
  • Added ble.sh and starship prompt for a better bash experience after running petalin.sh

The original README.md from docker-petalinux is copied below:

Generic Petalinux Dockerfile

A somehow generic Xilinx PetaLinux 2020+ docker file, using Ubuntu (though some >tweaks might be possible for Windows).

It was successfully tested with version 2022.2.

Inspired by docker-xilinx-petalinux-desktop (and some of petalinux-docker).

Petalinux installer

Download PetaLinux installer from Xilinx/AMD website.

N.B. Petalinux 2022.2 installer is named petalinux-v2022.2-10141622-installer.>run so you want to either rename it to petalinux-v2022.2-final-installer.run >or create a link.

Build the image

Building the image requires a local HTTP server to serve big resources instead of >pushing them to the Docker daemon so make sure the firewall is configured >appropriately to allow incoming connections on docker network link tcp:172.17.0.>1:8000, e.g.:

sudo ufw allow from 172.17.0.0/16 to 172.17.0.1

Run:

./docker_build.sh

<VERSION> can be 2022.2, ... Corresponding petalinux and SDK files are expected to be found in resources >directory.

The docker_build.sh will automatically spawn a simple HTTP server to serve the >installers instead of copying them to the docker images (especially pushing >them to the Docker daemon. Big space/time saver).

The image takes a some time to build, but should succeed.

It weighs around 12 GB.

Parameters

Several arguments can be provided to customize the build, with --build-arg:

  • XILVER for the Xilinx version to install. The Dockerfile expects to find $>{HTTP_SERVER}/petalinux-v${XILVER}-final-installer.run for the PetaLinux >installer (unless PETALINUX_INSTALLER is given).
    Defaults to 2022.2.

  • PETALINUX_BASE is the name of the PetaLinux base. Petalinux will be installed >in /opt/${PETALINUX_BASE} and the installer is expected to be sourced from >resources/${PETALINUX_BASE}-installer.run.
    Defaults to petalinux-v${XILVER}-final.

  • PETALINUX_INSTALLER is the PetaLinux installer file.
    Defaults to ${PETALINUX_BASE}-installer.run

  • HTTP_SERV is the HTTP server serving both SDK and PetaLinux installer.
    Defaults to http://172.17.0.1:8000/resources.

You can fully customize the installation by manually running e.g.:

docker build . -t petalinux:2022.2
--build-arg XILVER=2022.2
--build-arg PETALINUX_INSTALLER=petalinux/petalinux-v2022.>2-10141622-installer.run
--build-arg HTTP_SERV=https://local.company.com/dockers/petalinux/2022.2/>resources

Petalinux at https://local.company.com/dockers/petalinux/2022.2/resources/>petalinux/petalinux-v2022.2-10141622-patched.run

Work with a PetaLinux project

A helper script petalin.sh is provided that should be run inside a petalinux >project directory. It basically is a shortcut to:

docker run -ti -v "$PWD":"$PWD" -w "$PWD" --rm -u petalinux petalinux:version> $@

When run without arguments, a shell will spawn, with PetaLinux and SDK settings.>sh already sourced, so you can directly execute petalinux-* commands.

user@host:/path/to/petalinux_project$ /path/to/petalin.sh petalinux@a3ce6f8c:/path/to/petalinux_project$ petalinux-create -t project >--template zynq -n petalinux@a3ce6f8c:/path/to/petalinux_project$ petalinux-config >--get-hw-description <...> petalinux@a3ce6f8c:/path/to/petalinux_project$ petalinux-build

Otherwise, the arguments will be executed as a command.

N.B. the SDK and PetaLinux settings.sh will not be sourced when running >commands:

user@host:/path/to/petalinux_project$ /path/to/petalin.sh petalinux-build

will fail because petalinux-build is not part of the path. But you can create >your own script and start it instead:

mbuild.sh

. /opt/petalinux-v2018.2-final/settings.sh petalinux-build

then:

user@host:/path/to/petalinux_project$ /path/to/petalin.sh ./mbuild.sh

About

Docker Image Generation for Petalinux, updated for Petalinux 2024.1

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Dockerfile 78.7%
  • Shell 21.3%