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

Attempting to create a Codenvy workspace with Java, Tomcat, Maven, Ant and Postgres #2413

Closed
terrywbrady opened this issue Sep 14, 2017 · 4 comments

Comments

@terrywbrady
Copy link

I am seeking advice on how to create a workspace containing Java, Tomcat, Maven, Ant and Postgres.

I found the stack that contains Java, Tomcat and Maven. I was able to add Ant to my recipe.

I am having trouble configuring Postgres within my workspace.

I summarized my issue here: https://stackoverflow.com/questions/46207960/add-postgres-to-a-codenvy-stack-recipe-dockerfile

I attempted to follow the instructions in the following ticket without success. #2027

[DOCKER] Unpacking pgdg-keyring (2017.1) ...
[DOCKER] Selecting previously unselected package postgresql-client-common.
[DOCKER] Preparing to unpack .../postgresql-client-common_184.pgdg80+1_all.deb ...
[DOCKER] Unpacking postgresql-client-common (184.pgdg80+1) ...
[DOCKER] Selecting previously unselected package ssl-cert.
[DOCKER] Preparing to unpack .../ssl-cert_1.0.37_all.deb ...
[DOCKER] Unpacking ssl-cert (1.0.37) ...
[DOCKER] Selecting previously unselected package postgresql-common.
[DOCKER]
[DOCKER] Preparing to unpack .../postgresql-common_184.pgdg80+1_all.deb ...
[DOCKER]
[DOCKER] Adding 'diversion of /usr/bin/pg_config to /usr/bin/pg_config.libpq-dev by postgresql-common'
[DOCKER] Unpacking postgresql-common (184.pgdg80+1) ...
[DOCKER] Processing triggers for systemd (229-4ubuntu17) ...
[DOCKER] Setting up logrotate (3.8.7-2ubuntu2.16.04.2) ...
[DOCKER] Setting up pgdg-keyring (2017.1) ...
[DOCKER]
[DOCKER] Setting up postgresql-client-common (184.pgdg80+1) ...
[DOCKER] Setting up ssl-cert (1.0.37) ...
[DOCKER] debconf: unable to initialize frontend: Dialog
debconf: (No usable dialog-like program is installed, so the dialog based frontend cannot be used. at /usr/share/perl5/Debconf/FrontEnd/Dialog.pm line 76.)
debconf: falling back to frontend: Readline
[DOCKER] Setting up postgresql-common (184.pgdg80+1) ...
[DOCKER] debconf: unable to initialize frontend: Dialog
debconf: (No usable dialog-like program is installed, so the dialog based frontend cannot be used. at /usr/share/perl5/Debconf/FrontEnd/Dialog.pm line 76.)
debconf: falling back to frontend: Readline
[DOCKER] Adding user postgres to group ssl-cert
[DOCKER] Creating config file /etc/postgresql-common/createcluster.conf with new version
[DOCKER]
[DOCKER] invoke-rc.d: could not determine current runlevel
[DOCKER]
[DOCKER] invoke-rc.d: policy-rc.d denied execution of start.
[DOCKER] Processing triggers for systemd (229-4ubuntu17) ...
[DOCKER] Reading package lists...
[DOCKER]
[DOCKER] Building dependency tree...
[DOCKER] Reading state information...
[DOCKER]
[DOCKER] [91mE: Version '9.6.2-1.pgdg80+1' for 'postgresql-9.6' was not found
E: Version '9.6.2-1.pgdg80+1' for 'postgresql-contrib-9.6' was not found
�[0m
[DOCKER] Removing intermediate container 94722ee05ec6
[DOCKER]
[DOCKER] [ERROR] Failed to build image: The command '/bin/sh -c sudo apt-get update && sudo apt-get install -y postgresql-common && sudo sed -ri 's/#(create_main_cluster) .$/\1 = false/' /etc/postgresql-common/createcluster.conf && sudo apt-get install -y postgresql-$PG_MAJOR=$PG_VERSION postgresql-contrib-$PG_MAJOR=$PG_VERSION && sudo rm -rf /var/lib/apt/lists/' returned a non-zero code: 100

@ghost ghost added the kind/question label Sep 17, 2017
@ghost
Copy link

ghost commented Sep 17, 2017

@terrywbrady you need to find out actual versions of postgres for ubuntu 16.0. At least, this is what pops int my mind when I look at the error.

@terrywbrady
Copy link
Author

Thank you @eivantsov. I modified my stack and I got a bit further.

https://github.com/terrywbrady/che-dockerfiles/blob/master/recipes/ubuntu_jdk8_dspace/Dockerfile

Unfortunately, I am not familiar with the actions being performed in this script. I imagine that I need to update the key value on this line: https://github.com/terrywbrady/che-dockerfiles/blob/master/recipes/ubuntu_jdk8_dspace/Dockerfile#L23

Here are the errors that I currently see. I appreciate any additional advice that you can offer.

[DOCKER] Step 11/25 : ENV PATH $JAVA_HOME/bin:$M2_HOME/bin:$ANT_HOME/bin:$PATH
[DOCKER] ---> Running in da0466142071
[DOCKER] ---> 4d93aae20f4d
[DOCKER] Removing intermediate container da0466142071
[DOCKER] Step 12/25 : RUN mkdir /home/user/tomcat8 /home/user/apache-maven-$MAVEN_VERSION $ANT_HOME && wget -qO- "https://www.apache.org/dist/ant/binaries/apache-ant-$ANT_VERSION-bin.tar.gz" | tar -zx --strip-components=1 -C $ANT_HOME && wget -qO- "http://apache.ip-connect.vn.ua/maven/maven-3/$MAVEN_VERSION/binaries/apache-maven-$MAVEN_VERSION-bin.tar.gz" | tar -zx --strip-components=1 -C /home/user/apache-maven-$MAVEN_VERSION/ && wget -qO- "http://archive.apache.org/dist/tomcat/tomcat-8/v8.0.24/bin/apache-tomcat-8.0.24.tar.gz" | tar -zx --strip-components=1 -C /home/user/tomcat8 && rm -rf /home/user/tomcat8/webapps/* && echo "export MAVEN_OPTS=$JAVA_OPTS" >> /home/user/.bashrc
[DOCKER] ---> Running in e09ec2952a0e
[DOCKER] ---> 8075f4f1d26b
[DOCKER] Removing intermediate container e09ec2952a0e
[DOCKER] Step 13/25 : RUN set -ex; key='B97B0AFCAA1A47F044F244A07FCC7D46ACCC4CF8'; export GNUPGHOME="$(mktemp -d)"; sudo gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$key"; sudo gpg --export "$key" > /etc/apt/trusted.gpg.d/postgres.gpg; rm -r "$GNUPGHOME"; sudo apt-key list
[DOCKER] ---> Running in 9ef3aee5bcae
[DOCKER] [91m+ key=B97B0AFCAA1A47F044F244A07FCC7D46ACCC4CF8
mktemp -d
[0m
[DOCKER] [91m+ export GNUPGHOME=/tmp/tmp.abpGLbnyYg
sudo gpg --keyserver ha.pool.sks-keyservers.net --recv-keys B97B0AFCAA1A47F044F244A07FCC7D46ACCC4CF8
[0m
[DOCKER] [91mgpg: directory /home/user/.gnupg' created [0m [DOCKER] [91mgpg: new configuration file /home/user/.gnupg/gpg.conf' created
gpg: WARNING: options in /home/user/.gnupg/gpg.conf' are not yet active during this run [0m [DOCKER] [91mgpg: keyring /home/user/.gnupg/secring.gpg' created
[0m
[DOCKER] [91mgpg: keyring `/home/user/.gnupg/pubring.gpg' created
[0m
[DOCKER] [91mgpg: requesting key ACCC4CF8 from hkp server ha.pool.sks-keyservers.net
[0m
[DOCKER] [91mgpg: /home/user/.gnupg/trustdb.gpg: trustdb created
gpg: key ACCC4CF8: public key "PostgreSQL Debian Repository" imported
[0m
[DOCKER] [91mgpg: no ultimately trusted keys found
gpg: Total number processed: 1
gpg: imported: 1 (RSA: 1)
[0m
[DOCKER] [91m/bin/sh: 1: cannot create /etc/apt/trusted.gpg.d/postgres.gpg: Permission denied

  • sudo gpg --export B97B0AFCAA1A47F044F244A07FCC7D46ACCC4CF8
    [0m
    [DOCKER] Removing intermediate container 9ef3aee5bcae
    [DOCKER]
    [DOCKER] [ERROR] Failed to build image: The command '/bin/sh -c set -ex; key='B97B0AFCAA1A47F044F244A07FCC7D46ACCC4CF8'; export GNUPGHOME="$(mktemp -d)"; sudo gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$key"; sudo gpg --export "$key" > /etc/apt/trusted.gpg.d/postgres.gpg; rm -r "$GNUPGHOME"; sudo apt-key list' returned a non-zero code: 2

@ghost
Copy link

ghost commented Sep 21, 2017

@terrywbrady before step 13 insert an instruction

USER root
and after it
USER user

@terrywbrady
Copy link
Author

Thank you @eivantsov ! This worked for me.

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

No branches or pull requests

1 participant