-
Notifications
You must be signed in to change notification settings - Fork 13
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 dumb-init + running as unprivileged user #18
base: master
Are you sure you want to change the base?
Conversation
add [dumb-init](https://github.com/Yelp/dumb-init) to [prevent zombie reaping problem](https://blog.phusion.nl/2015/01/20/docker-and-the-pid-1-zombie-reaping-problem/). add security by running as unprivileged user ![yolo](http://i.giphy.com/aLdiZJmmx4OVW.gif)
Any chance to use 💯 on alpine update and creating a new user. |
hey @smazurov, you don't need i yesterday listen to the rancher monthly talk in the background and heared them talking about that they used the interval or timeout stuff for a poor mans cron. i played with that a bit before using your container with ranger-compose.yml but was not really working. do you have experience with that. another thing i wanted to ask is if there is a reason that you don't build your container automatically? im playing right now on a test server at home where security is not a big thing but pulling in non automatic builds feels always kind of risky. |
yeah that stuff makes sense - just that docker chose tini for their zombie killing stuff in
Not sure what you mean - I feel like running timeouts is such a hack job, which is why I wrote this in the first place.
I haven't seen a good example of building a go program remotely then stuffing it into a minimal image and pushing it to dockerhub (or having hub do the whole process themselves), have you? I have no problems setting it up - in fact thats preferred! |
i guess really not that big different if you use tini or dumb-init and i also not really care since both do more or less the same thing. if you prefere tini i don't mind to change the url and make a new pr, i just think having any init service on pid 1 running makes the container more "best practice like" :) with interval or timeout i mean the following: there is a interval setting for rancher-compose and i heard the guys from rancher in a webcast talking about that they somehow used this for a "poor mans cron" to restart container in a given interval. i will dig deeper how to do that but i thought maybe you know about that. about the golang stuff. i have no golang experience so far but looking forward to learn more about it (saw it a lot in docker stuff and github coming). the docker automatic build basically takes your dockerfile and execute all the commands and then deploy it automatically. your container will then be tagged as automatic build and user can see whats inside (to prevent sneaking some bad stuff into the networks). in case of go i guess u compile your source and get a binary. so u just add that binary to the repo and add it in your dockerfile via copy. to make it fully transparent you could build the go binary with travis. |
update: i could not find the binary |
including binaries is an anti-pattern. Even non-automatic builds show a dockerfile used to build the image - there is no difference. Feel free to change it to tini via apk, and switch it to entry point, no need for new PR, i'll squash it anyway |
i build most of the docker stuff but i have a issue with govendor. what im doing so far:
when i then run
my env vars in the container:
some idear how to fix that? |
if The actual code needs to live in |
thanks for the tip, govendor sync is working now, but i guess u need to update somehow your dependencies or something. after i run
i can fix this manual by running:
so i guess this needs to be added to the vendor.json or something (sorry im not a go programmer, just a guess). and last thing not sure if we have to fix it or if its ok to ignore is this warning when running
but stuff gets build and the executable is running ... i will add post a live example in a few minutes ... |
ok done. i created a docker build which is fully transparent. you can find running container here: https://hub.docker.com/r/ellerbrock/alpine-rancher-cron/ The Repository for that build is here: https://github.com/ellerbrock/docker-collection/tree/master/dockerfiles/alpine-rancher-cron In case you like how stuff is i can make a new pull request. Cheers |
cgo is needed to build a linux-compatible binary on a non-linux host (like macOs). Since you're building everything in one container, maybe you can just run
Its quite clever to install all dependancies then remove them, but perhaps its better to separate build and run into different containers. Docker Hub supports build hooks in exactly the same way as Docker Cloud. So an ideal solution would be to build a "build" image, compile the source inside with mounted folder, then have dockerhub build the run image. At any rate, your solution mostly works, but it uninstalls Additionally, you can probably use
|
thanks for the response. do i have to install something for fetch?
i also tried local in an empty folder to use go get:
good that i came to this repo. yesterday night i finally took the chance and started to learn go programming :) later on i will check your idear with the docker hooks, not really heard about that before. lets try to fix the current go get hack first. |
Update rancher-cron
and thanks for the service!
i was looking for a way to run my cloudflare-dynamic-dns-updater and other small services in a scheduled way without the need of sleep and lots of running containers ...