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

Add Support for use CMD to start container #924

Closed
swift1911 opened this issue Sep 3, 2018 · 11 comments
Closed

Add Support for use CMD to start container #924

swift1911 opened this issue Sep 3, 2018 · 11 comments
Assignees
Milestone

Comments

@swift1911
Copy link

swift1911 commented Sep 3, 2018

I use supervise like s6-overlay to handle PID 1 for container, jib plugin use entrypoint to start container and overwrite my baseimage entrypoint, so i want to use CMD to start jib generated container

like this:

<container>
            <jvmFlags>
                  <jvmFlag>-javaagent:/data0/java/deploy/pinpoint.agent/pinpoint-bootstrap.jar</jvmFlag>
                  <jvmFlag>-Dpinpoint.agentId=docker</jvmFlag>
                  <jvmFlag>-Dpinpoint.applicationName=docker-test</jvmFlag>
            </jvmFlags>
      <mainClass>com.fangdd.bwfs.server.container.Application</mainClass>
      <exec>CMD</exec>
</container>
@chanseokoh
Copy link
Member

chanseokoh commented Sep 4, 2018

Hi @swift1911,

Let me check if I understood you correctly: you don't want Jib to overwrite the entrypoint and CMD, and you want Jib to just inherit and use the entrypoint and CMD that whatever base image has, right?

@swift1911
Copy link
Author

@chanseokoh Yes, this is the meaning

@chanseokoh
Copy link
Member

Now the question is, where/how to indicate Jib to not overwrite the entrypoint and CMD, e.g., a new configuration parameter or a system property?

@chanseokoh chanseokoh removed their assignment Sep 5, 2018
@coollog coollog added this to the v0.10.0 milestone Sep 5, 2018
@swift1911
Copy link
Author

@chanseokoh i think that a a new configuration parameter is better

@coollog
Copy link
Contributor

coollog commented Sep 11, 2018

Hi @swift1911 , what is the specific entrypoint (full container entrypoint) that you would like to run your container with? We are trying to understand your use case.

@swift1911
Copy link
Author

swift1911 commented Sep 12, 2018

@coollog this is my Dockerile, i want to use s6-overlay to init and handle pid 1,if jib use entrypoint to run java application, it will override my init

FROM alpine
RUN apk add busybox-extras bash vim lsof strace pstree git curl tzdata
ADD https:/just-containers/s6-overlay/releases/download/v1.21.4.0/s6-overlay-amd64.tar.gz /tmp/
RUN gunzip -c /tmp/s6-overlay-amd64.tar.gz | tar -xf - -C /
ENV TZ Asia/Shanghai
ENTRYPOINT ["/init"]

@loosebazooka
Copy link
Member

@swift1911 so you're expected execution is something like?

/init java -cp <some-classpath> <some-main-class> ...

@swift1911
Copy link
Author

@loosebazooka yes

@coollog
Copy link
Contributor

coollog commented Sep 14, 2018

Hi @swift1911, have you tried using the <entrypoint> configuration?

<container>
  <entrypoint>/init</entrypoint>
</container>

@swift1911
Copy link
Author

@coollog in some condition, /init command might be replace by other, hard code /init in jib may cause tech debt

@chanseokoh
Copy link
Member

The feature to inherit ENTRYPOINT and CMD will be available in the next release.

Gradle: jib.container.entrypoint = 'INHERIT'
Maven: <container><entrypoint>INHERIT</entrypoint></container>

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

4 participants