<p>I am having rough time trying to create a docker image that exposes <a href="https://developers.cloudflare.com/argo-tunnel/downloads/" rel="nofollow noreferrer">Cloudflare's Tunnel</a> executable for linux. Thus far I got to this stage with my docker image for it (image comes from <a href="https://github.com/jakejarvis/docker-cloudflare-argo/blob/master/Dockerfile" rel="nofollow noreferrer">https://github.com/jakejarvis/docker-cloudflare-argo/blob/master/Dockerfile</a>)</p>

<pre><code>FROM ubuntu:18.04

LABEL maintainer="Jake Jarvis &lt;jake@jarv.is&gt;"

RUN apt-get update \
  &amp;&amp; apt-get install -y --no-install-recommends wget ca-certificates \
  &amp;&amp; rm -rf /var/lib/apt/lists/*

RUN wget -O cloudflared.tgz https://bin.equinox.io/c/VdrWdbjqyF/cloudflared-stable-linux-amd64.tgz \
  &amp;&amp; tar -xzvf cloudflared.tgz \
  &amp;&amp; rm cloudflared.tgz \
  &amp;&amp; chmod +x cloudflared

ENTRYPOINT ["./cloudflared"]
</code></pre>

<p>And following <a href="https://developers.cloudflare.com/argo-tunnel/reference/sidecar/" rel="nofollow noreferrer">official documentation for their kubernetes setup</a> I added it to my deployment as a sidecar via: (here <code>cloudflare-argo:5</code> is image built from dockerfile above)</p>

<pre><code>    - name: cloudflare-argo
      image: my-registry/cloudflare-argo:5
      imagePullPolicy: Always
      command: ["cloudflared", "tunnel"]
      args:
        - --url=http://localhost:8080
        - --hostname=my-website
        - --origincert=/etc/cloudflared/cert.pem
        - --no-autoupdate
      volumeMounts:
        - mountPath: /etc/cloudflared
          name: cloudflare-argo-secret
          readOnly: true
      resources:
        requests:
          cpu: "50m"
        limits:
          cpu: "200m"
  volumes:
    - name: cloudflare-argo-secret
      secret:
        secretName: my-website.com
</code></pre>

<p>However once I deploy I get <code>CrashLoopBackOff</code> error on my pod with following <code>kubectl describe</code> output</p>

<blockquote>
  <p>Created container cloudflare-argo</p>
  
  <p>Error: failed to start container "cloudflare-argo": Error response from daemon: OCI runtime create failed: container_linux.go:349: starting container process caused "exec: \"cloudflared\": executable file not found in $PATH": unknown</p>
</blockquote>

Ilja
<p>In the dockerfile it is <code>./cloudflared</code>, so that would be:</p>

<pre><code>      command:
        - ./cloudflared
        - tunnel
        - --url=http://localhost:8080
        - --hostname=my-website
        - --origincert=/etc/cloudflared/cert.pem
        - --no-autoupdate
</code></pre>

<p>(also there is no reason to use both <code>command</code> and <code>args</code>, just pick one, if you drop the first item then use <code>args</code>).</p>
