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

[Branch-2.8]Fix pulsar_standalone docker image build failed #11862

Conversation

hangc0276
Copy link
Contributor

Motivation

When build the pulsar-standalone docker image, it throw the following exception

[INFO] + sudo -u postgres /usr/lib/postgresql/11/bin/initdb /data/
[INFO]
[INFO] sudo: /usr/lib/postgresql/11/bin/initdb: command not found
[INFO]
[ERROR] The command '/bin/sh -c /pulsar/django/init-postgres.sh' returned a non-zero code: 1
[WARNING] An attempt failed, will retry 1 more times
org.apache.maven.plugin.MojoExecutionException: Could not build image
    at com.spotify.plugin.dockerfile.BuildMojo.buildImage (BuildMojo.java:247)
    at com.spotify.plugin.dockerfile.BuildMojo.execute (BuildMojo.java:135)
    at com.spotify.plugin.dockerfile.AbstractDockerMojo.tryExecute (AbstractDockerMojo.java:265)
    at com.spotify.plugin.dockerfile.AbstractDockerMojo.execute (AbstractDockerMojo.java:254)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:956)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:192)
    at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:498)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)

The root cause is when we use ubuntu 20.04 use base docker image instead of openjdk:11-jdk image introduce by #11026 , the ubuntu 20.04 will install postgresql 12 instead of postgresql 11 by default. However, the init and start script has been hard code with postgresql 11 install path, which will lead to command not found exception.

Modification

  1. add postgresql 11 resource address for ubuntu 20.04 and install postgresql 11

Copy link
Contributor

@eolivelli eolivelli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM
in 2.9.0 we dropped Standalone.
it is fine to keep it in 2.8.0 at the moment
thanks

@hangc0276
Copy link
Contributor Author

LGTM
in 2.9.0 we dropped Standalone.
it is fine to keep it in 2.8.0 at the moment
thanks

@eolivelli Yes, it just tag it into 2.8.1

@hangc0276 hangc0276 merged commit 78a155b into apache:branch-2.8 Aug 31, 2021
gaoran10 added a commit to gaoran10/pulsar that referenced this pull request Sep 10, 2021
2. Build python client by Python3.8

cherry-pick:
1. apache#11026
2. apache#11623
3. apache#11862
codelipenghui pushed a commit that referenced this pull request Sep 14, 2021
### Motivation

Currently, the docker is from `openjdk:8-jdk-slim `, it has a new release a few days ago and the Linux version was changed to `Impish`, it didn't support install `python3.7` by apt-get tool, the minimum Python version is 3.9, so we need to change the python version or use a different Linux release, I cherry-pick some commits from branch master to build docker image from the `ubuntu:20.04`.

Mainly related PRs:

1. #11026
2. #11623
3. #11862

### Modifications

Build docker image from the `ubuntu:20.04`.

upgrade pulsar-go-client from `0.2.0` to `0.6.0` and rever #9124 from branch-2.7
nicoloboschi pushed a commit to datastax/pulsar that referenced this pull request Jul 22, 2022
Currently, the docker is from `openjdk:8-jdk-slim `, it has a new release a few days ago and the Linux version was changed to `Impish`, it didn't support install `python3.7` by apt-get tool, the minimum Python version is 3.9, so we need to change the python version or use a different Linux release, I cherry-pick some commits from branch master to build docker image from the `ubuntu:20.04`.

Mainly related PRs:

1. apache#11026
2. apache#11623
3. apache#11862

Build docker image from the `ubuntu:20.04`.

upgrade pulsar-go-client from `0.2.0` to `0.6.0` and rever apache#9124 from branch-2.7

(cherry picked from commit 259c698)
nicoloboschi pushed a commit to datastax/pulsar that referenced this pull request Jul 22, 2022
Currently, the docker is from `openjdk:8-jdk-slim `, it has a new release a few days ago and the Linux version was changed to `Impish`, it didn't support install `python3.7` by apt-get tool, the minimum Python version is 3.9, so we need to change the python version or use a different Linux release, I cherry-pick some commits from branch master to build docker image from the `ubuntu:20.04`.

Mainly related PRs:

1. apache#11026
2. apache#11623
3. apache#11862

Build docker image from the `ubuntu:20.04`.

upgrade pulsar-go-client from `0.2.0` to `0.6.0` and rever apache#9124 from branch-2.7

(cherry picked from commit 259c698)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants