go4droid icon indicating copy to clipboard operation
go4droid copied to clipboard

Dockerfile: include pkg-config for Go builds that need C libs

Open eighthave opened this issue 5 years ago • 7 comments

for example: https://github.com/keroserene/go-webrtc

Here's the build log: https://gitlab.com/eighthave/snowflake/-/jobs/111223574

eighthave avatar Oct 22 '18 18:10 eighthave

at first glance it LGTM, but I'll have another look later, thanks.

mpl avatar Oct 22 '18 18:10 mpl

@eighthave I don't understand the build log you pasted above. You seem to be pulling the go4droid image, but you don't seem to be using it to build an android project with gradlew, are you? So I don't see what's preventing you from installing pkg-config outside of the go4droid image. I'm not familiar with gitlab, can you please point me to the configuration/build/Dockerfile file responsible for the build you linked to, so I can get a better idea?

mpl avatar Oct 23 '18 13:10 mpl

I'm using it only to build a Go CLI tool for Android right now. Gitlab CI is just a straight docker runner. Look at the "test-template" job to see what it is doing: https://gitlab.com/eighthave/snowflake/blob/master/.gitlab-ci.yml

What gitlab-ci does is check out snowflake.git then runs the commands in the docker image you specify. This is all run on their servers, not on my machine.

eighthave avatar Oct 23 '18 14:10 eighthave

Sorry, I'd like to re-familiarize myself with android building before answering that. And while I'm at it I'll probably update all the deps in this image if possible, and depending on what the latest from golang.org/x/mobile wants/needs. I'll need a bit of time.

mpl avatar Oct 23 '18 15:10 mpl

@eighthave hey. I don't really see why pkg-config needs to be added to mpl7/go4droid, and not just installed after, on top of it. Can you show me (with a Dockerfile, or whatever else) how you would like to use the image please?

mpl avatar Oct 31 '18 19:10 mpl

since the Dockerfile sets the User, it is not possible during runtime to install pkg-config. There is no possibility to use sudo. In an normal gitlab-ci run, it is possible to run things as root without a password.

eighthave avatar Nov 01 '18 21:11 eighthave

@eighthave I see. Would that help as an alternative then: https://github.com/mpl/go4droid/pull/5 ?

mpl avatar Nov 03 '18 17:11 mpl