Git Product home page Git Product logo

Comments (12)

jfloff avatar jfloff commented on September 16, 2024 1

Build on DockerHub updated.

Also, here is the new bacon.env file. Check if it has the right values.

Thank you for your help! Sorry about the delay

from docker-lineageos.

jfloff avatar jfloff commented on September 16, 2024

Hello,

This image started as my own use, so having this feedback is excellent! Thank you in advance :)

Could you show me the steps you took to start building the image?

Thank you!

from docker-lineageos.

GRBurst avatar GRBurst commented on September 16, 2024

Hey,

thanks for your reply!

EDIT:

For sake of completeness: I pulled docker pull jfloff/lineageos

I called it with the following parameters:

docker run --rm --privileged -v $(pwd)/android:/home/lineageos --env-file dockerbuild/bacon.env -ti jfloff/lineageos

the bacon.env contains the following:

#!/bin/bash
GIT_USER_NAME=GRBurst
GIT_USER_EMAIL=[masked]
BASE_DIR=/home/lineageos
LINEAGEOS_REPO=https://github.com/LineageOS/android.git
LINEAGEOS_BRANCH=cm-14.1
USE_CCACHE=1
CCACHE_SIZE=75G
CCACHE_COMPRESS=1
CCACHE_DIR=/home/lineageos/ccache
ANDROID_JACK_VM_ARGS="-Dfile.encoding=UTF-8 -XX:+TieredCompilation -Xmx8G"
WITH_SU=false
DEVICE_CODENAME=bacon
PROPRIETARY_BLOBS_REPO=https://github.com/TheMuppets/proprietary_vendor_oneplus
PROPRIETARY_BLOBS_DIR=/home/lineageos/vendor/oneplus

I masked the E-Mail above, but I set a correct one in bacon.env.
As you can see I hardcoded the paths for e.g. CCACHE. That is not really an issue but I would prefere to write it like that:

#!/bin/bash
GIT_USER_NAME=GRBurst
GIT_USER_EMAIL=[masked]
BASE_DIR="/home/$USER"
LINEAGEOS_REPO=https://github.com/LineageOS/android.git
LINEAGEOS_BRANCH=cm-14.1
USE_CCACHE=1
CCACHE_SIZE=75G
CCACHE_COMPRESS=1
CCACHE_DIR="$BASE_DIR/ccache"
ANDROID_JACK_VM_ARGS="-Dfile.encoding=UTF-8 -XX:+TieredCompilation -Xmx8G"
WITH_SU=false
DEVICE_CODENAME=bacon
PROPRIETARY_BLOBS_REPO=https://github.com/TheMuppets/proprietary_vendor_oneplus
PROPRIETARY_BLOBS_DIR="$BASE_DIR/vendor/oneplus"

from docker-lineageos.

jfloff avatar jfloff commented on September 16, 2024

Just so you know, I'm looking at it! Just holidays are in the way :)

Happy new year!

from docker-lineageos.

GRBurst avatar GRBurst commented on September 16, 2024

Hey thanks and a happy new year to you, too :-)

I just played a bit and read your code. The problem concerning the environment variables seems to be caused by just sourcing them, but instead, you must force them to get expanded.
As far as I understand this can be achieved using envsubst in the init.sh script, see SO.

from docker-lineageos.

jfloff avatar jfloff commented on September 16, 2024

Sorry about being slow answering this, thing is I was struggling with my computer and didn't had enough space to build android. I think its all good now.

Question, could you paste the output of printenv once you are inside the container? Let's focus on the 2nd version of your .env file, the one you think should work.
Run the container only with printenv:

docker run --rm --privileged -v $(pwd)/android:/home/lineageos --env-file dockerbuild/bacon.env -ti jfloff/lineageos printenv

Paste the output so I can check :)

Thank you so much! Let's fix this 💪

from docker-lineageos.

jfloff avatar jfloff commented on September 16, 2024

I found out that this is a problem from the Docker env-file parameter. It doesn't interpret variables in a bash-like way (moby/moby#26009).

This is clearly visible when I backup the current environment (https://github.com/jfloff/docker-lineageos/blob/master/init.sh#L8), it comes with all the quotes and dollar escaped:

declare -x BASE_DIR="\"/home/\$USER\""
declare -x CCACHE_DIR="\"\$BASE_DIR/ccache\""
declare -x PROPRIETARY_BLOBS_DIR="\"\$BASE_DIR/vendor/oneplus\""

According to their PR (moby/moby#28092 (comment)) implementing this would be like implementing another shell. However, we need some solution for this. I think the best way would be to do some seding on the result of declare -xp, we unescape the first and last quotes and the dollar signs.

I'm thinking of replacing https://github.com/jfloff/docker-lineageos/blob/master/init.sh#L8 with something along these lines:

declare -px | sed -e 's/"\\"/"/g; s/\\""/"/g; s/\\\$/\$/g' > /tmp/current.env

What do you think? Its not perfect, but that's what could be done with Docker's limitation.

from docker-lineageos.

GRBurst avatar GRBurst commented on September 16, 2024

Okay that one is ugly but if it works 😀

from docker-lineageos.

jfloff avatar jfloff commented on September 16, 2024

Yes, it is indeed ... You do whatcha gotta do :)

from docker-lineageos.

jfloff avatar jfloff commented on September 16, 2024

Ok, I also was able to init and build with your bacon details. I'm even adding them to the repository, feel free to edit them afterwards.

I guess this closes the issue. Commit incoming and new builds for Docker Hub also on the way.

from docker-lineageos.

jfloff avatar jfloff commented on September 16, 2024

@GRBurst could you confirm me that everything is working?

from docker-lineageos.

GRBurst avatar GRBurst commented on September 16, 2024

@jfloff yes, I will try it on the weekend :-)

from docker-lineageos.

Related Issues (8)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.