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

Dockerfile ENTRYPOINT doesn't pass along extra arguments from "docker run" #5631

Closed
tomjakubowski opened this issue Mar 30, 2019 · 2 comments

Comments

Projects
None yet
2 participants
@tomjakubowski
Copy link
Contributor

commented Mar 30, 2019

When I'm running syncthing from the Docker image, I would often like to pass it additional command line arguments. My expectation, based on other "application" images I've used (pdal is one example), is that extra arguments to docker run would be passed on to syncthing in the container.

To reproduce:

docker run --pull syncthing/syncthing -help

Expected behavior: help text is printed, as with syncthing -help.

Actual behavior: syncthing starts like nothing was passed:

% docker run syncthing/syncthing -help
[monitor] 01:23:27 INFO: Starting syncthing
[start] 01:23:27 INFO: Generating ECDSA key and certificate for syncthing...
[BRLLT] 01:23:27 INFO: syncthing v1.1.0 "Erbium Earthworm" (go1.11.6 linux-amd64) docker@syncthing.net 2019-02-25 18:25:08 UTC
[BRLLT] 01:23:27 INFO: My ID: BRLLTIP-EZSBBHZ-OZJLDQH-SPQWQGD-VT7UQWK-MFFNRSM-5G72AVM-XOEXYA7
[BRLLT] 01:23:28 INFO: Single thread SHA256 performance is 380 MB/s using crypto/sha256 (377 MB/s using minio/sha256-simd).
[... truncated]

Docker image version: 61de83be0df4


I believe this can be addressed through some combination of using the exec form of ENTRYPOINT and, optionally, CMD for "default" arguments that would be thrown away if the user provides any. See https://docs.docker.com/engine/reference/builder/#entrypoint

@tomjakubowski tomjakubowski changed the title Dockerfile ENTRYPOINT doesn't pass along extra arguments Dockerfile ENTRYPOINT doesn't pass along extra arguments from "docker run" Mar 30, 2019

@calmh calmh added the enhancement label Mar 30, 2019

@calmh

This comment has been minimized.

Copy link
Member

commented Mar 30, 2019

We do some chowning and stuff in the entrypoint so I think the easiest way to make this work correctly is have a small wrapper script that does its thing and then exec:s syncthing, along with any optional arguments.

tomjakubowski added a commit to Oblong/syncthing that referenced this issue Apr 3, 2019

tomjakubowski added a commit to Oblong/syncthing that referenced this issue Apr 3, 2019

tomjakubowski added a commit to Oblong/syncthing that referenced this issue Apr 3, 2019

tomjakubowski added a commit to Oblong/syncthing that referenced this issue Apr 3, 2019

@tomjakubowski

This comment has been minimized.

Copy link
Contributor Author

commented Apr 3, 2019

Pull request submitted here: #5635

tomjakubowski added a commit to Oblong/syncthing that referenced this issue Apr 8, 2019

@calmh calmh closed this in cc36621 May 18, 2019

calmh added a commit to calmh/syncthing that referenced this issue May 23, 2019

Merge branch 'master' into crashrep
* master: (25 commits)
  gui, man, authors: Update docs, translations, and contributors
  lib/model: Consistently cleanup model in tests (syncthing#5724)
  golang-ci: Turn up the heat
  cmd/ursrv: Lint fixes
  build(deps): bump github.com/prometheus/client_golang (syncthing#5729)
  lib/model, lib/testutils: Test closing a connection on folder restart (syncthing#5707)
  lib/model: Fix test flakyness regression (ref syncthing#5592) (syncthing#5718)
  test: Report time per MiB on transfer benchs (syncthing#5711)
  docker: Create entrypoint script (fixes syncthing#5631) (syncthing#5635)
  lib/model: Refactor file deletions when pulling (syncthing#5699)
  cmd/ursrv: Add F-droid and some third party distributors to the distrubtion summary
  lib/api, lib/connections, gui: Show connection error for disconnected devices (fixes syncthing#3345) (syncthing#5727)
  authors: Update acolomb (fixes syncthing#5726)
  cmd/ursrv: Summarize known distribution channels
  gui, man, authors: Update docs, translations, and contributors
  lib/model: Remove superfluous check for IndexID in remote ClusterConfig (syncthing#5717)
  build(deps): bump github.com/lib/pq from 1.0.0 to 1.1.1 (syncthing#5714)
  build(deps): bump github.com/oschwald/geoip2-golang from 1.1.0 to 1.3.0 (syncthing#5713)
  build(deps): bump github.com/mattn/go-isatty from 0.0.4 to 0.0.7 (syncthing#5712)
  build(deps): bump github.com/gogo/protobuf from 1.2.0 to 1.2.1 (syncthing#5715)
  ...

@calmh calmh added this to the v1.2.0 milestone May 27, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.