Commit d8b6eee8 authored by Oleksii Kutuzov's avatar Oleksii Kutuzov

Update all

parent b21d13a4
# dev-containers # dev-containers
docker run --rm -it --mount type=bind,source="$(pwd)",target=/mnt/dev <container_name> ## Running containers
\ No newline at end of file
```docker run --rm -it -v $(pwd):/mnt/dev <container_name>```
## Building and pushing to Container Registry
### Preparation
1. Login to container registry with your git credentials
```docker login gitlab.keith-koep.com:5050```
### Build and push
1. Navigate to the directory of the container you want to build
2. Build with
```docker build docker build -t gitlab.keith-koep.com:5050/imx/uboot-imx:<flavour, which is a directory name> .```
or with prepared script
```./build.sh```
3. Push with
```docker push gitlab.keith-koep.com:5050/imx/uboot-imx:<flavour, which is a directory name>```
or with prepared script
```./push.sh```
4. You can rebuild the container without using build cache with
```docker build --no-cache -t gitlab.keith-koep.com:5050/imx/uboot-imx:<flavour, which is a directory name> .```
## Build multi-arch containers
### Preparation steps
1. Check which builders are available
```docker buildx ls```
2. Create a custom builder `kuk-builder`
```docker buildx create --name kuk-builder default```
3. Choose this bulder to use by default
```docker buildx use kuk-builder```
### Build and push
1. Build and push with
```docker buildx build --platform linux/amd64,linux/arm64 -t gitlab.keith-koep.com:5050/imx/uboot-imx:<flavour name> --push . ```
or with prepared script
```./build-multiarch-and-push.sh```
\ No newline at end of file
...@@ -23,7 +23,8 @@ RUN apt-get update && \ ...@@ -23,7 +23,8 @@ RUN apt-get update && \
bison \ bison \
libz-dev \ libz-dev \
bc \ bc \
kmod kmod \
clang-format
# Unpack the SDK to /opt/fsl-imx-wayland/4.14-sumo # Unpack the SDK to /opt/fsl-imx-wayland/4.14-sumo
RUN wget --no-check-certificate ${FILE_URL} && \ RUN wget --no-check-certificate ${FILE_URL} && \
......
#!/bin/bash #!/bin/bash
docker build -t gitlab.keith-koep.com:5050/imx/uboot-imx:fsl-imx-fb_4.14-sumo . docker build -t gitlab.keith-koep.com:5050/kutuzov/dev-containers/$(basename $(pwd)):latest .
\ No newline at end of file \ No newline at end of file
#!/bin/bash #!/bin/bash
docker push gitlab.keith-koep.com:5050/imx/uboot-imx:fsl-imx-fb_4.14-sumo docker push gitlab.keith-koep.com:5050/kutuzov/dev-containers/$(basename $(pwd)):latest
\ No newline at end of file \ No newline at end of file
#!/bin/bash #!/bin/bash
docker build --no-cache -t gitlab.keith-koep.com:5050/imx/uboot-imx:fsl-imx-fb_4.14-sumo . docker build --no-cache -t gitlab.keith-koep.com:5050/kutuzov/dev-containers/$(basename $(pwd)):latest .
\ No newline at end of file \ No newline at end of file
#!/bin/bash #!/bin/bash
docker build -t fsl-imx-wayland_4.14-sumo_qt . docker build -t gitlab.keith-koep.com:5050/kutuzov/dev-containers/$(basename $(pwd)):latest .
\ No newline at end of file \ No newline at end of file
#!/bin/bash
docker push gitlab.keith-koep.com:5050/kutuzov/dev-containers/$(basename $(pwd)):latest
\ No newline at end of file
# Using debian because ubuntu casuses errors for arm64 platform
FROM debian:buster AS build
LABEL name=fsl-imx-wayland_5.10-hardknott-multiarch
LABEL maintainer="oleksii.kutuzov@seco.com"
SHELL ["/bin/bash", "-c"]
ENV DEBIAN_FRONTEND noninteractive
ENV DEBIAN_FRONTEND teletype
ENV URL "https://source.codeaurora.org/external/imx/imx-manifest"
ENV MANIFEST "imx-5.10.35-2.0.0.xml"
ENV MACHINE "imx8mm-lpddr4-evk"
ENV DISTRO "fsl-imx-xwayland"
ENV RECIPE "core-image-minimal"
# Generate and apply locales
RUN apt-get update && \
apt-get upgrade && \
apt-get install -y locales && rm -rf /var/lib/apt/lists/* \
&& localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8
ENV LANG en_US.utf8
# Install dependencies
RUN apt-get update && \
apt-get install --fix-missing -y \
zip \
unzip \
wget \
build-essential \
python3 \
python3-distutils \
python \
git \
flex \
bison \
libz-dev \
bc \
curl \
expect \
chrpath \
cpio \
diffstat \
gawk \
perl \
perl-modules \
kmod && \
apt-get autoclean
# Add user
RUN useradd -ms /bin/bash dev
USER dev
WORKDIR /home/dev
# Get repo in the system
RUN mkdir -p ~/.bin && \
curl https://storage.googleapis.com/git-repo-downloads/repo > ~/.bin/repo && \
chmod a+rx ~/.bin/repo
# Copy expect script to accept the license agreement during the build setup
COPY --chown=dev sync.exp /tmp/sync.exp
# Build yocto, install SDK and remove build files
RUN mkdir ~/imx-linux-hardknott && \
cd ~/imx-linux-hardknott && \
~/.bin/repo init -u ${URL} -b imx-linux-hardknott -m ${MANIFEST} && \
~/.bin/repo sync -c -j8
RUN cd ~/imx-linux-hardknott && \
# Setup the build environment with expect script
chmod +x /tmp/sync.exp && \
/tmp/sync.exp && \
MACHINE=${MACHINE} DISTRO=${DISTRO} source setup-environment build-xwayland && \
MACHINE=${MACHINE} DISTRO=${DISTRO} bitbake ${RECIPE} -c populate_sdk
# Switch to root to unpack the SDk
USER root
RUN cd /home/dev/imx-linux-hardknott/build-xwayland/tmp/deploy/sdk/ && \
./${DISTRO}-glibc-x86_64-${RECIPE}-cortexa53-crypto-${MACHINE}-toolchain-5.10-hardknott.sh && \
rm -rf /home/dev/imx-linux-hardknott
# #
# # Use multi-stage builds and utilize build cache. In this case we can have as many as required
# # layers and copy the data from it. This results in a single layer image
# #
FROM debian:buster
COPY --from=build /opt /opt
SHELL ["/bin/bash", "-c"]
# Install dependencies
RUN apt-get update && \
apt-get install -y \
zip \
unzip \
wget \
build-essential \
python3 \
git \
flex \
bison \
libz-dev \
bc \
kmod \
libssl-dev
RUN useradd -ms /bin/bash dev
USER dev
WORKDIR /home/dev
# Set environment on container startup
RUN echo '. /opt/fsl-imx-xwayland/5.10-hardknott/environment-setup-cortexa53-crypto-poky-linux' >> ~/.bashrc
# Clone imx-mkimage as user inside the container
RUN git clone https://git.seco.com/seco-ne/3rd-party/kuk/imx-mkimage-kuk.git -b kuk_lf-5.10.52_2.1.0 /home/dev/imx-mkimage_5.10
\ No newline at end of file
## Currently under development
\ No newline at end of file
#! /bin/bash
# Shows builders installed
docker buildx ls
# Check if custom builder exists. Create otherwise
if [[ -z $(docker buildx ls | grep kuk-builder) ]]; then
docker buildx create --name kuk-builder default
fi
# Use builder that supports platform
docker buildx use kuk-builder
# Build for linux/amd64, linux/arm64
docker buildx build --platform linux/arm64,linux/amd64 -t gitlab.keith-koep.com:5050/kutuzov/dev-containers/$(basename $(pwd)):latest --push .
\ No newline at end of file
#!/bin/bash
docker build -t gitlab.keith-koep.com:5050/kutuzov/dev-containers/$(basename $(pwd)):latest .
\ No newline at end of file
#!/bin/bash
docker push gitlab.keith-koep.com:5050/kutuzov/dev-containers/$(basename $(pwd)):latest
\ No newline at end of file
#!/bin/bash
docker build --no-cache -t gitlab.keith-koep.com:5050/kutuzov/dev-containers/$(basename $(pwd)):latest .
\ No newline at end of file
#! /usr/bin/expect -f
set timeout -1
spawn bash -c "MACHINE=imx8mm-lpddr4-evk DISTRO=fsl-imx-xwayland source ./imx-setup-release.sh -b build-xwayland"
sleep 5
send "q"
expect "(y/n)"
sleep 1
send "y\r"
expect eof
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment