Giter Site home page Giter Site logo

Comments (4)

bryanburgers avatar bryanburgers commented on August 17, 2024 1

Currently my docker-compose.yml has to look something like this in order to be able to successfully use influx in a docker-compose environment.

services:
  influxdb:
    image: influxdb
    environment:
      INFLUXDB_ADMIN_ENABLED: "true"
  
  influxdb_create_instance:
    image: tutum/curl
    command: /bin/sh -c 'sleep 2 && curl -X POST -G http://influxdb:8086/query --data-urlencode "q=CREATE DATABASE metrics"'

This is not ideal because (a) it involves an extra docker container, which clutters up the docker-compose file and has to run every time docker-compose up is run, and (b) sleeps for an arbitrary amount of time to try to wait until influxdb is ready, which could fail due to variability in how long influx takes to start.

Compare that to MySQL, which can create a database right from the image

services:
  mysql:
    image: mysql
    environment:
      MYSQL_DATABASE: metrics

or in a pinch, can even specify custom commands to run when the database is ready.

services:
  mysql:
    image: mysql   
    environment:
      MYSQL_DATABASE: metrics
    volumes:
      - ./init.sql:/docker-entrypoint-initdb.d/init.sql

from influxdata-docker.

jsternberg avatar jsternberg commented on August 17, 2024 1

This feature exists now. I just need to document it. It was merged in #131.

from influxdata-docker.

bryanburgers avatar bryanburgers commented on August 17, 2024

Yay! Thanks!

I can confirm that this now works:

services:
  influxdb:
    image: influxdb
    environment:
      INFLUXDB_ADMIN_ENABLED: "true"
      INFLUXDB_DB: metrics

from influxdata-docker.

jsternberg avatar jsternberg commented on August 17, 2024

I submitted the documentation change in docker-library/docs#1014.

from influxdata-docker.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.