Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

u3d/install fails to install Linux dependencies inside docker #240

Closed
4 tasks done
IvanRibakov opened this issue Jan 23, 2018 · 6 comments
Closed
4 tasks done

u3d/install fails to install Linux dependencies inside docker #240

IvanRibakov opened this issue Jan 23, 2018 · 6 comments

Comments

@IvanRibakov
Copy link

IvanRibakov commented Jan 23, 2018

Issue Checklist

  • I'm using the latest u3d version
  • I ran u3d --help
  • I read the README
  • I made sure that a similar issue doesn't exit

Issue Description

I'm trying to prepare a docker container with a particular Linux version of Unity3D. I've used ruby image as a parent image.

FROM ruby
(the only line in Dockerfile)

As I'm still experimenting I am connected to a running container directly via docker run -it <container> /bin/bash

I was able to install latest (1.0.15) version of u3d.

root@75e7cf93ad38:/# gem install u3d
Fetching: colored-1.2.gem (100%)
Successfully installed colored-1.2
Fetching: highline-1.7.10.gem (100%)
Successfully installed highline-1.7.10
Fetching: commander-4.4.4.gem (100%)
Successfully installed commander-4.4.4
Fetching: tins-1.16.3.gem (100%)
Successfully installed tins-1.16.3
Fetching: file-tail-1.2.0.gem (100%)
Successfully installed file-tail-1.2.0
Fetching: filesize-0.1.1.gem (100%)
Successfully installed filesize-0.1.1
Fetching: inifile-3.0.0.gem (100%)
Successfully installed inifile-3.0.0
Fetching: plist-3.4.0.gem (100%)
Successfully installed plist-3.4.0
Fetching: security-0.1.3.gem (100%)
Successfully installed security-0.1.3
Fetching: u3d-1.0.15.gem (100%)
Successfully installed u3d-1.0.15
10 gems installed

However when I ran u3d dependencies I was prompted for user/password, even though I was already running command as root. Ok, I went and set password for root using passwd, but even when entering correct credentials, I still get an error below:

root@75e7cf93ad38:/# u3d dependencies --trace
Install dependencies? (38 dependency(ies) to install) (y/n)
y
$ apt-get -y install gconf-service lib32gcc1 lib32stdc++6 libasound2 libc6 libc6-i386 libcairo2 libcap2 libcups2 libdbus-1-3 libexpat1 libfontconfig1 libfreetype6 libgcc1 libgconf-2-4 libgdk-pixbuf2.0-0 libgl1-mesa-glx libglib2.0-0 libglu1-mesa libgtk2.0-0 libnspr4 libnss3 libpango1.0-0 libstdc++6 libx11-6 libxcomposite1 libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxtst6 zlib1g debconf npm libpq5
Username for u3d:

Username for u3d:
root
Password for root:
****
No credentials storage available
Traceback (most recent call last):
	15: from /usr/local/bundle/bin/u3d:23:in `<main>'
	14: from /usr/local/bundle/bin/u3d:23:in `load'
	13: from /usr/local/bundle/gems/u3d-1.0.15/exe/u3d:7:in `<top (required)>'
	12: from /usr/local/bundle/gems/u3d-1.0.15/lib/u3d/commands_generator.rb:37:in `start'
	11: from /usr/local/bundle/gems/u3d-1.0.15/lib/u3d/commands_generator.rb:209:in `run'
	10: from /usr/local/bundle/gems/commander-4.4.4/lib/commander/delegates.rb:15:in `run!'
	 9: from /usr/local/bundle/gems/commander-4.4.4/lib/commander/runner.rb:68:in `run!'
	 8: from /usr/local/bundle/gems/commander-4.4.4/lib/commander/runner.rb:446:in `run_active_command'
	 7: from /usr/local/bundle/gems/commander-4.4.4/lib/commander/command.rb:153:in `run'
	 6: from /usr/local/bundle/gems/commander-4.4.4/lib/commander/command.rb:178:in `call'
	 5: from /usr/local/bundle/gems/u3d-1.0.15/lib/u3d/commands_generator.rb:180:in `block (2 levels) in run'
	 4: from /usr/local/bundle/gems/u3d-1.0.15/lib/u3d/commands.rb:150:in `install_dependencies'
	 3: from /usr/local/bundle/gems/u3d-1.0.15/lib/u3d/installer.rb:402:in `install'
	 2: from /usr/local/bundle/gems/u3d-1.0.15/lib/u3d_core/command_executor.rb:74:in `execute'
	 1: from /usr/local/bundle/gems/u3d-1.0.15/lib/u3d_core/command_executor.rb:89:in `execute_command'
/usr/local/bundle/gems/u3d-1.0.15/lib/u3d_core/command_executor.rb:103:in `execute_command_low': Exit status: 127 (RuntimeError)

Possibly not related to the original issue, but calling u3d --help fails with message:
/bin/sh: 1: less: not found

P.S. I tried settings U3D_PASSWORD variable, but that just spared me the interactive prompt for user/pass but returned same error as mentioned earlier.

P.P.S. Ruby version that Docker image comes with is 2.5.0 if that is of any significance.

@lacostej
Copy link
Member

Hello Ivan. The error is not related to credentials but to command execution.

  • the "No credentials storage available" is just a message saying that your password won't be saved. It can be ignored.

  • the missing less issue is caused by commander.
    https://github.com/tj/commander/blob/d10fc03ce9d44a0a34bb913df99dded4a0bd5287/lib/commander/user_interaction.rb#L289-L292
    We can work around that issue by either pointing the PAGER environment variable to something useful or installing less on your docker image

  • the real issue in u3d is the fact that the command to install the Linux dependencies fails with status 127. The command it tries to run is printed above. I.e. apt-get -y install gconf-service lib32gcc1 lib32stdc++6....

Is this the right way to install the dependencies on your docker image? Maybe you need to install them yourselves using the mechanism specific to your Linux distribution.

@lacostej lacostej changed the title "No credentials storage available" inside docker when running "u3d dependencies" as root u3d/install fails to install Linux dependencies inside docker Jan 24, 2018
@IvanRibakov
Copy link
Author

Thanks for clarifying what was going on. Running apt-get manually provided necessary information to resolve the issue. Should have thought of it earlier...

@lacostej
Copy link
Member

@IvanRibakov could you let me know what was preventing apt-get to run properly when ran through u3d? Thanks!

@IvanRibakov
Copy link
Author

Docker ruby container was unable to find package npm. I ended up installing it "by hand" (comes with nodejs package in my case). Btw, I think I saw somewhere on the forums that you were considering setting up docker images - perhaps you could use below ones as a starting point. My idea was to have 2 containers, one for builds that would have u3d and Unity and nothing else, and the other as a workspace that would come with NuGet, Nunit and Gendarme.

FROM ruby

RUN apt-get update && apt-get install -y curl sudo

RUN curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -

RUN apt-get install -y gconf-service lib32gcc1 lib32stdc++6 libasound2 libc6 libc6-i386 libcairo2 libcap2 libcups2 libdbus-1-3 libexpat1 libfontconfig1 libfreetype6 libgcc1 libgconf-2-4 libgdk-pixbuf2.0-0 libgl1-mesa-glx libglib2.0-0 libglu1-mesa libgtk2.0-0 libnspr4 libnss3 libpango1.0-0 libstdc++6 libx11-6 libxcomposite1 libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxtst6 zlib1g debconf libpq5 nodejs

RUN gem install u3d

# TODO - install a version of Unity here. Aiming at 2017.3 but not sure headless install will work on Linux with it

And here's what I ended up hacking together for the workspace:

FROM ubuntu:14.04

RUN apt-get update && apt-get install -y curl sudo gendarme

RUN curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.gpg && \
    mv microsoft.gpg /etc/apt/trusted.gpg.d/microsoft.gpg && \
    sh -c 'echo "deb [arch=amd64] https://packages.microsoft.com/repos/microsoft-ubuntu-trusty-prod trusty main" > /etc/apt/sources.list.d/dotnetdev.list'

RUN apt-get install -y apt-transport-https && \
    apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF && \
    echo "deb http://download.mono-project.com/repo/ubuntu trusty main" | sudo tee /etc/apt/sources.list.d/mono-official.list && \
    apt-get update && \
    apt-get install -y mono-devel ca-certificates-mono nunit-console

RUN mkdir /opt/nuget && \
    curl https://dist.nuget.org/win-x86-commandline/v4.4.1/nuget.exe -o /opt/nuget/nuget.exe && \
    NUGET_SCRIPT='#!/bin/sh\nmono /opt/nuget/nuget.exe "$@"' && \
    echo -e $NUGET_SCRIPT > /usr/bin/nuget && \
    chmod +x /usr/bin/nuget

Keep in mind I haven't battle-tested this, just checked that all tools execute once container is built.

@lacostej
Copy link
Member

lacostej commented Feb 4, 2018

@IvanRibakov thanks for the feedback.

Not sure when I will have time to look into docker properly, but if you want to discuss it, feel free to drop a line

@frostebite
Copy link

frostebite commented Apr 29, 2019

Hey,

having similar issues on ubuntu docker image trying to install with u3d.

Install command seems to work.
Cannot get the Locals warning to stop appearing.
Dependencies command fails.
Using u3d run also fails due to the dependencies issue.

@lacostej would be great to get this working. Happy to follow up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants