Ad Widget

Collapse

Curl inside docker container

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • richirojoli
    Junior Member
    • Jun 2020
    • 4

    #1

    Curl inside docker container

    Hi,

    I am using the alpine version of the zabbix/zabbix-server-pgsql docker container and one of my alert scripts needs a curl command but the curl binary is missing.
    Is there anyone who knows how to install curl inside the docker container Zabbix server?

    I tried the ubuntu version too, but in both I cannot install with apt or apk since the user is zabbix not root

    Thanks for the help in advance!
  • Matgou
    Junior Member
    • Nov 2020
    • 4

    #2
    Hi richirojoli ,

    The best solution is to write a Dockerfile like bellow and build your own docker-image:
    Code:
    FROM zabbix/zabbix-server-pgsql
    
    USER root
    RUN apk add curl
    
    USER zabbix
    Build with :
    Code:
    docker build -t richirojoli/zabbix-server-pgsql-curl .
    If you just want to have a bash as root in existing container you can try : [CODE]docker exec -it -u root <container_id> /bin/bash[CODE], but remember your customization will be lost if you recreate your container.

    By,

    Comment


    • richirojoli
      richirojoli commented
      Editing a comment
      That might be the best solution, thank you
Working...