Comments (6)
It looks like Heroku is processing Dockerfiles in a non-compliant way.
$ # The way docker interprets the image entrypoint and cmd:
ENTRYPOINT ["/docker-entrypoint.sh"]
CMD ["haproxy", "-f", "/usr/local/etc/haproxy/haproxy.cfg"]
$ # becomes
$ # run this executable in the image: "/docker-entrypoint.sh"
$ # with these arguments: "haproxy" "-f" "/usr/local/etc/haproxy/haproxy.cfg"
$ # ie eqivalent to bash:
$ /docker-entrypoint.sh haproxy -f /usr/local/etc/haproxy/haproxy.cfg
$ # whereas it looks like heroku is doing this:
$ # run this executable in the image: "/docker-entrypoint.sh"
$ # with this argument: "haproxy -f /usr/local/etc/haproxy/haproxy.cfg"
$ # ie eqivalent to bash:
$ /docker-entrypoint.sh 'haproxy -f /usr/local/etc/haproxy/haproxy.cfg'
You should be able to do the following in your Dockerfile to override the entrypoint:
FROM haproxy:1.6-alpine
COPY haproxy.cfg /usr/local/etc/haproxy/haproxy.cfg
ENTRYPOINT []
CMD ["haproxy", "-f", "/usr/local/etc/haproxy/haproxy.cfg"]
# though you could also do one of these, since heroku interprets it this way anyway:
ENTRYPOINT ["/bin/sh", "-c"]
CMD ["haproxy -f /usr/local/etc/haproxy/haproxy.cfg"]
ENTRYPOINT []
CMD haproxy -f /usr/local/etc/haproxy/haproxy.cfg
from haproxy.
Awesome and thanks for the quick reply!
Here's my results from trying the solutions you provided:
Works:
ENTRYPOINT []
CMD ["haproxy", "-f", "/usr/local/etc/haproxy/haproxy.cfg"]
ENTRYPOINT []
CMD haproxy -f /usr/local/etc/haproxy/haproxy.cfg
Doesn't work:
ENTRYPOINT ["/bin/sh", "-c"]
CMD ["haproxy -f /usr/local/etc/haproxy/haproxy.cfg"]
from haproxy.
That is a bit unexpected. π Well at least it is working on some and hopefully this conversation can help more people in the future when they get "command not found" when deploying to heroku using docker images.
from haproxy.
Cool. I opened a ticket on heroku as well referencing this issue. We'll see how it goes.
from haproxy.
This is the response I got:
Thanks for reporting this issue, we indeed process ENTRYPOINT and CMD slightly different than docker due to the nature of Heroku environment, we will prefix your CMD with /bin/sh -l -c when no ENTRYPOINT is specified to will make sure your heroku config vars (including those you defined your Dockerfile during the build of your image) are loaded (-l) and available for your CMD execution, we are aware of this difference (I believe this is also noted in the public documentation, if not I will make sure to update) but we are also working on a better support for ENTRYPOINT + CMD combinations, for now your workaround is correct and should also be supported when we ship better support for entrypoint and cmd.
from haproxy.
Closing given that this is a downstream issue (not something we can fix in the image itself).
from haproxy.
Related Issues (20)
- The password of USER haproxy by defaultοΌ HOT 1
- I'm using this: HOT 2
- Release haproxy image with lua version >= 5.4.2 HOT 2
- High CPU usage with 2.6.3 (latest) docker image HOT 4
- Cannot open configuration file /usr/local/etc/haproxy/haproxy.cfg: No such file or directory HOT 6
- Memory exhaustion using haproxy image HOT 3
- OOM killed using haproxy image HOT 5
- core dumps not being stored HOT 7
- Use /var/run/docker.sock as backend server HOT 2
- Why build from source code? HOT 2
- [ALERT] (1) : [haproxy.main()] Cannot create pidfile /var/run/haproxy.pid HOT 2
- If you have a new enough kernel (`4.11`), then adding `--sysctl net.ipv4.ip_unprivileged_port_start=0` to the `docker run` should allow it to use "privileged" ports (https://github.com/moby/moby/issues/8460). HOT 1
- CVE-2023-25725 HOT 6
- How to deal with "Failed to drop supplementary groups"? HOT 2
- Vulnerable component detection issue HOT 3
- "ltime" converter does not reflect container timezone HOT 4
- Haproxy not reloading config in docker HOT 1
- Crtitical/high vulnerabilities in all haproxy:bullseye images HOT 3
- HAProxy crashing on start, thread 2 is about to kill the process. HOT 11
- Images contain `*-dev` packages that are used to build HAProxy but which are useless at runtime
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from haproxy.