mirror of
https://github.com/openshwprojects/OpenBK7231T_App.git
synced 2026-02-20 00:32:37 +01:00
Add UID of user when building to avoid permission issue (#1343)
* Add UID of user when building to avoid permission issue * Add way to change timezone too
This commit is contained in:
@@ -2,6 +2,10 @@ FROM --platform=linux/amd64 ubuntu:20.04
|
|||||||
|
|
||||||
ARG DEBIAN_FRONTEND=noninteractive
|
ARG DEBIAN_FRONTEND=noninteractive
|
||||||
ARG USERNAME=devuser
|
ARG USERNAME=devuser
|
||||||
|
ARG UID=1000
|
||||||
|
ARG TZ="Etc/UTC"
|
||||||
|
|
||||||
|
RUN echo "$TZ" > /etc/timezone
|
||||||
|
|
||||||
RUN dpkg --add-architecture i386 \
|
RUN dpkg --add-architecture i386 \
|
||||||
&& apt-get update \
|
&& apt-get update \
|
||||||
@@ -13,7 +17,7 @@ RUN dpkg --add-architecture i386 \
|
|||||||
|
|
||||||
RUN pip3 install pycryptodomex configobj toml fdt
|
RUN pip3 install pycryptodomex configobj toml fdt
|
||||||
|
|
||||||
RUN useradd -m -s /bin/bash ${USERNAME}
|
RUN useradd -m -s /bin/bash -u "${UID}" ${USERNAME}
|
||||||
|
|
||||||
COPY build_target_platforms.sh /build_target_platforms.sh
|
COPY build_target_platforms.sh /build_target_platforms.sh
|
||||||
RUN chmod 775 /build_target_platforms.sh
|
RUN chmod 775 /build_target_platforms.sh
|
||||||
|
|||||||
@@ -3,10 +3,24 @@
|
|||||||
This docker will build all or some of the platforms that OpenBeken supports. To use, first build the docker image:
|
This docker will build all or some of the platforms that OpenBeken supports. To use, first build the docker image:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
docker build -t openbk_build --build-arg USERNAME=$USER .
|
docker build -t openbk_build --build-arg UID=$UID --build-arg USERNAME=$USER .
|
||||||
|
```
|
||||||
|
|
||||||
|
Note that the current user name and user ID is passed through to the docker image build.
|
||||||
|
This is to preserve local file permissions when OpenBeken is built.
|
||||||
|
|
||||||
|
If you want to change the timezone you can use the argument TZ for that like
|
||||||
|
|
||||||
|
```sh
|
||||||
|
docker build -t openbk_build --build-arg UID=$UID --build-arg USERNAME=$USER --build-arg TZ="Etc/UTC" .
|
||||||
|
```
|
||||||
|
|
||||||
|
or
|
||||||
|
|
||||||
|
```sh
|
||||||
|
docker build -t openbk_build --build-arg UID=$UID --build-arg USERNAME=$USER --build-arg TZ="Asia/Tokyo" .
|
||||||
```
|
```
|
||||||
|
|
||||||
Note that the current user name is passed through to the docker image build. This is to preserve local file permissions when OpenBeken is built.
|
|
||||||
|
|
||||||
Once the docker image is build, you can use it to build the SDKs as follows (assumed you are in the current `docker` directory):
|
Once the docker image is build, you can use it to build the SDKs as follows (assumed you are in the current `docker` directory):
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user