Skip to content

Instantly share code, notes, and snippets.

@smly
Last active January 19, 2016 01:13
Show Gist options
  • Select an option

  • Save smly/7334560 to your computer and use it in GitHub Desktop.

Select an option

Save smly/7334560 to your computer and use it in GitHub Desktop.

Revisions

  1. smly revised this gist Nov 10, 2013. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -117,6 +117,7 @@ Type "help", "copyright", "credits" or "license" for more information.
    '[{"username":""},{"username":"smly"}]'
    >>> ### Can't delete the ghost user...
    >>> ### (Resolved after https://github.com/influxdb/influxdb/commit/d7628935a)
    >>> resp = requests.delete(url + '/db/development/users/?u=root&p=root')
    >>> resp
    <Response [404]>
  2. smly revised this gist Nov 8, 2013. 1 changed file with 3 additions and 3 deletions.
    6 changes: 3 additions & 3 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -20,10 +20,10 @@ $ docker run bc16b7ab3dbd
    2013/11/06 13:46:50 Starting Http Api server on port 8086
    ````

    ### Using InfluxDB's HTTP API with Python-client (a fork of influxdb-python)
    ### Using InfluxDB's HTTP API with Python-client

    ````
    $ git clone http://github.com/smly/influxdb-python && cd influxdb-python
    $ git clone http://github.com/influxdb/influxdb-python && cd influxdb-python
    $ git checkout v0.1.1
    $ python --version
    @@ -45,7 +45,7 @@ Swtich user: root
    Delete database: example
    ````

    ### Using InfluxDB's HTTP API with Python
    ### Using InfluxDB's HTTP API with python-requests

    ````
    $ virtualenv venv
  3. smly revised this gist Nov 8, 2013. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion README.md
    Original file line number Diff line number Diff line change
    @@ -103,7 +103,7 @@ Type "help", "copyright", "credits" or "license" for more information.
    >>> ########
    >>> ### Get list of database users. wow, a ghost user '' is listed.
    >>> ### (Resolved after https://github.com/influxdb/influxdb/commit/d7628935aa72d52340cd97ecb31a8a4858729352)
    >>> ### (Resolved after https://github.com/influxdb/influxdb/commit/d7628935a)
    >>> resp = requests.get(url + '/db/development/users?u=root&p=root')
    >>> resp.content
    '[{"username":""}]'
  4. smly revised this gist Nov 8, 2013. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -103,6 +103,7 @@ Type "help", "copyright", "credits" or "license" for more information.
    >>> ########
    >>> ### Get list of database users. wow, a ghost user '' is listed.
    >>> ### (Resolved after https://github.com/influxdb/influxdb/commit/d7628935aa72d52340cd97ecb31a8a4858729352)
    >>> resp = requests.get(url + '/db/development/users?u=root&p=root')
    >>> resp.content
    '[{"username":""}]'
  5. smly revised this gist Nov 8, 2013. 1 changed file with 26 additions and 26 deletions.
    52 changes: 26 additions & 26 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    ### Setup
    ### Build InfluxDB container

    ````
    $ git clone https://gist.github.com/7334560.git
    @@ -20,6 +20,31 @@ $ docker run bc16b7ab3dbd
    2013/11/06 13:46:50 Starting Http Api server on port 8086
    ````

    ### Using InfluxDB's HTTP API with Python-client (a fork of influxdb-python)

    ````
    $ git clone http://github.com/smly/influxdb-python && cd influxdb-python
    $ git checkout v0.1.1
    $ python --version
    Python 2.7.3
    $ virtualenv venv
    $ source venv/bin/activate
    $ python setup.py install
    $ python examples/tutorial.py --host=172.17.0.57 --port=8086
    Create database: example
    Get list of database users: []
    Add database user: smly
    Get list of database users again: [{u'username': u'smly'}]
    Swtich user: smly
    Write points: [{'points': [['1', 1, 1.0], ['2', 2, 2.0]], 'name': 'foo', 'columns': ['column_one', 'column_two', 'column_three']}]
    Queying data: select column_one from foo;
    Result: [{"name":"foo","columns":["time","sequence_number","column_one"],"points":[[1383886725,2,"2"],[1383886725,1,"1"]]}]
    Swtich user: root
    Delete database: example
    ````

    ### Using InfluxDB's HTTP API with Python

    ````
    @@ -105,28 +130,3 @@ Type "help", "copyright", "credits" or "license" for more information.
    ''
    ````

    ### Using InfluxDB's HTTP API with Python-client (a fork of influxdb-python)

    ````
    $ git clone http://github.com/smly/influxdb-python && cd influxdb-python
    $ git checkout v0.1.1
    $ python --version
    Python 2.7.3
    $ virtualenv venv
    $ source venv/bin/activate
    $ python setup.py install
    $ python examples/tutorial.py --host=172.17.0.57 --port=8086
    Create database: example
    Get list of database users: []
    Add database user: smly
    Get list of database users again: [{u'username': u'smly'}]
    Swtich user: smly
    Write points: [{'points': [['1', 1, 1.0], ['2', 2, 2.0]], 'name': 'foo', 'columns': ['column_one', 'column_two', 'column_three']}]
    Queying data: select column_one from foo;
    Result: [{"name":"foo","columns":["time","sequence_number","column_one"],"points":[[1383886725,2,"2"],[1383886725,1,"1"]]}]
    Swtich user: root
    Delete database: example
    ````
  6. smly revised this gist Nov 8, 2013. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -20,7 +20,7 @@ $ docker run bc16b7ab3dbd
    2013/11/06 13:46:50 Starting Http Api server on port 8086
    ````

    ### Test
    ### Using InfluxDB's HTTP API with Python

    ````
    $ virtualenv venv
    @@ -106,7 +106,7 @@ Type "help", "copyright", "credits" or "license" for more information.
    ````

    ### forked python-client
    ### Using InfluxDB's HTTP API with Python-client (a fork of influxdb-python)

    ````
    $ git clone http://github.com/smly/influxdb-python && cd influxdb-python
  7. smly revised this gist Nov 8, 2013. 1 changed file with 18 additions and 35 deletions.
    53 changes: 18 additions & 35 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -106,44 +106,27 @@ Type "help", "copyright", "credits" or "license" for more information.
    ````

    ### forked client (WIP)
    ### forked python-client

    ````
    $ git clone http://github.com/smly/influxdb-python && cd influxdb-python
    $ git checkout v0.1.1
    $ python --version
    Python 2.7.3
    $ virtualenv venv
    $ source venv/bin/activate
    $
    $ git clone http://github.com/smly/influxdb-python
    $ cd influxdb-python
    $ python setup.py install
    $ cat > test.py
    from influxdb import InfluxDBClient
    def main():
    cli = InfluxDBClient('172.17.0.47', 8086, 'root', 'root', 'base_db')
    print("create database `test_db`")
    cli.create_database('test_db')
    users = cli.get_database_users()
    print("list of datatabase `test_db` users: {}".format(users))
    print("add database users `test_db`")
    cli.add_database_user('smly', 'standardml')
    users = cli.get_database_users()
    print("list of datatabase `test_db` users: {}".format(cli.get_database_users()))
    print("delete database `test_db`")
    cli.delete_database('test_db')
    if __name__ == '__main__':
    main()
    $ python test.py
    create database `test_db`
    list of datatabase `test_db` users: []
    add database users `test_db`
    list of datatabase `test_db` users: [{u'username': u'smly'}]
    delete database `test_db`
    $ python setup.py install
    $ python examples/tutorial.py --host=172.17.0.57 --port=8086
    Create database: example
    Get list of database users: []
    Add database user: smly
    Get list of database users again: [{u'username': u'smly'}]
    Swtich user: smly
    Write points: [{'points': [['1', 1, 1.0], ['2', 2, 2.0]], 'name': 'foo', 'columns': ['column_one', 'column_two', 'column_three']}]
    Queying data: select column_one from foo;
    Result: [{"name":"foo","columns":["time","sequence_number","column_one"],"points":[[1383886725,2,"2"],[1383886725,1,"1"]]}]
    Swtich user: root
    Delete database: example
    ````
  8. smly revised this gist Nov 6, 2013. 1 changed file with 0 additions and 1 deletion.
    1 change: 0 additions & 1 deletion README.md
    Original file line number Diff line number Diff line change
    @@ -122,7 +122,6 @@ from influxdb import InfluxDBClient
    def main():
    cli = InfluxDBClient('172.17.0.47', 8086, 'root', 'root', 'base_db')
    cli.delete_database('test_db')
    print("create database `test_db`")
    cli.create_database('test_db')
  9. smly revised this gist Nov 6, 2013. 1 changed file with 43 additions and 0 deletions.
    43 changes: 43 additions & 0 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -105,3 +105,46 @@ Type "help", "copyright", "credits" or "license" for more information.
    ''
    ````

    ### forked client (WIP)

    ````
    $ virtualenv venv
    $ source venv/bin/activate
    $
    $ git clone http://github.com/smly/influxdb-python
    $ cd influxdb-python
    $ python setup.py install
    $ cat > test.py
    from influxdb import InfluxDBClient
    def main():
    cli = InfluxDBClient('172.17.0.47', 8086, 'root', 'root', 'base_db')
    cli.delete_database('test_db')
    print("create database `test_db`")
    cli.create_database('test_db')
    users = cli.get_database_users()
    print("list of datatabase `test_db` users: {}".format(users))
    print("add database users `test_db`")
    cli.add_database_user('smly', 'standardml')
    users = cli.get_database_users()
    print("list of datatabase `test_db` users: {}".format(cli.get_database_users()))
    print("delete database `test_db`")
    cli.delete_database('test_db')
    if __name__ == '__main__':
    main()
    $ python test.py
    create database `test_db`
    list of datatabase `test_db` users: []
    add database users `test_db`
    list of datatabase `test_db` users: [{u'username': u'smly'}]
    delete database `test_db`
    ````
  10. smly revised this gist Nov 6, 2013. 1 changed file with 14 additions and 8 deletions.
    22 changes: 14 additions & 8 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -52,46 +52,52 @@ Type "help", "copyright", "credits" or "license" for more information.
    ... ]
    >>> url = 'http://172.17.0.47:8086'
    >>> headers={'Content-type': 'application/json', 'Accept': 'text/plain'}
    >>>
    >>> ### DB作成
    >>> ########
    >>> ### Create database
    >>> resp = requests.post(url + '/db?u=root&p=root', data=json.dumps({'name': 'development'}), headers=headers)
    >>> resp
    <Response [201]>
    >>> resp.content
    ''
    >>> ### DBユーザー一覧
    >>> ########
    >>> ### Get list of database users
    >>> resp = requests.get(url + '/db/development/users?u=root&p=root')
    >>> resp
    <Response [200]>
    >>> resp.content
    '[]'
    >>> ### ユーザー追加(間違えて user にしてしまった!)
    >>> ########
    >>> ### Add database user ('user' is not expected, but this request is accepted...)
    >>> resp = requests.post(url + '/db/development/users?u=root&p=root', data=json.dumps({'user': 'smly', 'password': 'standardml'}), headers=headers)
    >>> resp
    <Response [200]>
    >>> resp.content
    '' ### DBユーザー一覧.なんかおかしいユーザーが追加されてしまった.エラーハンドリングしないのね
    >>> ########
    >>> ### Get list of database users. wow, a ghost user '' is listed.
    >>> resp = requests.get(url + '/db/development/users?u=root&p=root')
    >>> resp.content
    '[{"username":""}]'
    >>> ### もう一度 username フィールドでユーザー追加.今度は正しく追加された
    >>> ########
    >>> ### Add database user again. 'username' is expected.
    >>> resp = requests.post(url + '/db/development/users?u=root&p=root', data=json.dumps({'username': 'smly', 'password': 'standardml'}), headers=headers)
    >>> resp = requests.get(url + '/db/development/users?u=root&p=root')
    >>> resp.content
    '[{"username":""},{"username":"smly"}]'
    >>> ### 空文字削除できない...
    >>> ### Can't delete the ghost user...
    >>> resp = requests.delete(url + '/db/development/users/?u=root&p=root')
    >>> resp
    <Response [404]>
    >>> resp.content
    '404 page not found\n'
    >>> ### DBユーザー追加してるので data point を追加する
    >>> ### Add data points.
    >>> resp = requests.post(url + '/db/development/series?u=smly&p=standardml', data=json.dumps(data), headers=headers)
    >>> resp
    <Response [200]>
  11. smly revised this gist Nov 6, 2013. No changes.
  12. smly revised this gist Nov 6, 2013. 1 changed file with 8 additions and 0 deletions.
    8 changes: 8 additions & 0 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -90,4 +90,12 @@ Type "help", "copyright", "credits" or "license" for more information.
    <Response [404]>
    >>> resp.content
    '404 page not found\n'
    >>> ### DBユーザー追加してるので data point を追加する
    >>> resp = requests.post(url + '/db/development/series?u=smly&p=standardml', data=json.dumps(data), headers=headers)
    >>> resp
    <Response [200]>
    >>> resp.content
    ''
    ````
  13. smly revised this gist Nov 6, 2013. 1 changed file with 73 additions and 2 deletions.
    75 changes: 73 additions & 2 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    # Usage
    ### Setup

    ````
    $ git clone https://gist.github.com/7334560.git
    @@ -19,4 +19,75 @@ $ docker run bc16b7ab3dbd
    2013/11/06 13:46:50 Starting admin interface on port 8083
    2013/11/06 13:46:50 Starting Http Api server on port 8086
    ````


    ### Test

    ````
    $ virtualenv venv
    $ source venv/bin/activate
    $ pip install requests
    $ python
    Python 2.7.5+ (default, Sep 19 2013, 13:48:49)
    [GCC 4.8.1] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    >>> import requests
    >>> import json
    >>>
    >>> data = [
    ... {
    ... "name": "events",
    ... "columns": ["state", "email", "type"],
    ... "points": [
    ... ["ny", "[email protected]", "follow"],
    ... ["ny", "[email protected]", "open"]
    ... ]
    ... },
    ... {
    ... "name": "errors",
    ... "columns": ["class", "file", "user", "severity"],
    ... "points": [
    ... ["DivideByZero", "example.py", "[email protected]", "fatal"]
    ... ]
    ... }
    ... ]
    >>> url = 'http://172.17.0.47:8086'
    >>> headers={'Content-type': 'application/json', 'Accept': 'text/plain'}
    >>>
    >>> ### DB作成
    >>> resp = requests.post(url + '/db?u=root&p=root', data=json.dumps({'name': 'development'}), headers=headers)
    >>> resp
    <Response [201]>
    >>> resp.content
    ''
    >>> ### DBユーザー一覧
    >>> resp = requests.get(url + '/db/development/users?u=root&p=root')
    >>> resp
    <Response [200]>
    >>> resp.content
    '[]'
    >>> ### ユーザー追加(間違えて user にしてしまった!)
    >>> resp = requests.post(url + '/db/development/users?u=root&p=root', data=json.dumps({'user': 'smly', 'password': 'standardml'}), headers=headers)
    >>> resp
    <Response [200]>
    >>> resp.content
    '' ### DBユーザー一覧.なんかおかしいユーザーが追加されてしまった.エラーハンドリングしないのね
    >>> resp = requests.get(url + '/db/development/users?u=root&p=root')
    >>> resp.content
    '[{"username":""}]'
    >>> ### もう一度 username フィールドでユーザー追加.今度は正しく追加された
    >>> resp = requests.post(url + '/db/development/users?u=root&p=root', data=json.dumps({'username': 'smly', 'password': 'standardml'}), headers=headers)
    >>> resp = requests.get(url + '/db/development/users?u=root&p=root')
    >>> resp.content
    '[{"username":""},{"username":"smly"}]'
    >>> ### 空文字削除できない...
    >>> resp = requests.delete(url + '/db/development/users/?u=root&p=root')
    >>> resp
    <Response [404]>
    >>> resp.content
    '404 page not found\n'
    ````
  14. smly revised this gist Nov 6, 2013. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion influxdb-install.sh
    Original file line number Diff line number Diff line change
    @@ -5,7 +5,8 @@ echo "deb http://us.archive.ubuntu.com/ubuntu/ precise-updates universe" >> /etc
    apt-get update
    apt-get -y install wget protobuf-compiler bzr mercurial bison flex g++ make git

    mkdir /opt && cd /opt
    mkdir /opt
    cd /opt

    cat <<EOF > /opt/goenv
    export GOROOT=/opt/go
  15. smly revised this gist Nov 6, 2013. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion influxdb-install.sh
    Original file line number Diff line number Diff line change
    @@ -9,7 +9,7 @@ mkdir /opt && cd /opt

    cat <<EOF > /opt/goenv
    export GOROOT=/opt/go
    export PATH=${PATH}:/opt/go/bin:/opt/gows/bin
    export PATH=${PATH}:/opt/go/bin
    EOF

    wget http://go.googlecode.com/files/go1.1.2.linux-amd64.tar.gz
  16. smly revised this gist Nov 6, 2013. 1 changed file with 1 addition and 3 deletions.
    4 changes: 1 addition & 3 deletions influxdb-install.sh
    Original file line number Diff line number Diff line change
    @@ -5,12 +5,10 @@ echo "deb http://us.archive.ubuntu.com/ubuntu/ precise-updates universe" >> /etc
    apt-get update
    apt-get -y install wget protobuf-compiler bzr mercurial bison flex g++ make git

    mkdir -p /opt/gows
    cd /opt
    mkdir /opt && cd /opt

    cat <<EOF > /opt/goenv
    export GOROOT=/opt/go
    export GOPATH=/opt/gows
    export PATH=${PATH}:/opt/go/bin:/opt/gows/bin
    EOF

  17. smly revised this gist Nov 6, 2013. 1 changed file with 17 additions and 0 deletions.
    17 changes: 17 additions & 0 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,22 @@
    # Usage

    ````
    $ git clone https://gist.github.com/7334560.git
    $ cd 7334560
    $ docker build .
    [snip]
    Successfully built bc16b7ab3dbd
    $ docker run bc16b7ab3dbd
    2013/11/06 13:46:49 Loading Config from config.json.sample
    2013/11/06 13:46:49 Starting Influx Server...
    2013/11/06 13:46:49 Opening database at /tmp/influxdb/development/db
    2013/11/06 13:46:49 Initializing Raft HTTP server
    2013/11/06 13:46:49 Listening at: http://localhost:8090
    2013/11/06 13:46:49 Initializing Raft Server: /tmp/influxdb/development/raft 8090
    2013/11/06 13:46:49 Couldn't contact a leader so initializing new cluster for server on port: 8090
    2013/11/06 13:46:50
    2013/11/06 13:46:50 Starting admin interface on port 8083
    2013/11/06 13:46:50 Starting Http Api server on port 8086
    ````

  18. smly revised this gist Nov 6, 2013. 1 changed file with 3 additions and 3 deletions.
    6 changes: 3 additions & 3 deletions influxdb-install.sh
    Original file line number Diff line number Diff line change
    @@ -8,10 +8,10 @@ apt-get -y install wget protobuf-compiler bzr mercurial bison flex g++ make git
    mkdir -p /opt/gows
    cd /opt

    echo <<EOF > /opt/goenv
    cat <<EOF > /opt/goenv
    export GOROOT=/opt/go
    export GOPATH=/opt/gows
    export PATH=${PATH}:${GOPATH}/bin:${GOROOT}/bin
    export PATH=${PATH}:/opt/go/bin:/opt/gows/bin
    EOF

    wget http://go.googlecode.com/files/go1.1.2.linux-amd64.tar.gz
    @@ -25,7 +25,7 @@ rm v0.0.7.tar.gz
    ln -s /opt/influxdb-0.0.7 /opt/influxdb
    cd /opt/influxdb

    echo <<EOF > /opt/influxdb/run
    cat <<EOF > /opt/influxdb/run
    #!/bin/bash
    source /opt/goenv
  19. smly revised this gist Nov 6, 2013. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion influxdb-install.sh
    Original file line number Diff line number Diff line change
    @@ -11,7 +11,7 @@ cd /opt
    echo <<EOF > /opt/goenv
    export GOROOT=/opt/go
    export GOPATH=/opt/gows
    export PATH=$PATH:$GOPATH/bin:$GOROOT/bin
    export PATH=${PATH}:${GOPATH}/bin:${GOROOT}/bin
    EOF

    wget http://go.googlecode.com/files/go1.1.2.linux-amd64.tar.gz
    @@ -35,4 +35,5 @@ EOF

    chmod a+x /opt/influxdb/run

    source /opt/goenv
    ./build.sh
  20. smly revised this gist Nov 6, 2013. 4 changed files with 40 additions and 30 deletions.
    23 changes: 2 additions & 21 deletions Dockerfile
    Original file line number Diff line number Diff line change
    @@ -1,26 +1,7 @@
    FROM ubuntu
    RUN mkdir -p /opt/gows
    RUN cd /opt
    ADD goenv /opt/goenv

    RUN echo "deb http://us.archive.ubuntu.com/ubuntu/ precise universe" >> /etc/apt/sources.list
    RUN echo "deb http://us.archive.ubuntu.com/ubuntu/ precise-updates universe" >> /etc/apt/sources.list
    RUN apt-get update
    RUN apt-get -y install wget protobuf-compiler bzr mercurial bison flex g++ make git

    RUN wget http://go.googlecode.com/files/go1.1.2.linux-amd64.tar.gz
    RUN tar zxvf go1.1.2.linux-amd64.tar.gz
    RUN rm go1.1.2.linux-amd64.tar.gz
    RUN wget https://github.com/influxdb/influxdb/archive/v0.0.7.tar.gz
    RUN tar zxvf v0.0.7.tar.gz
    RUN rm v0.0.7.tar.gz
    RUN ln -s /opt/influxdb-0.0.7 /opt/influxdb
    RUN cd /opt/influxdb
    RUN ./build.sh

    ADD run /opt/influxdb/run

    RUN chmod a+x /opt/influxdb/run
    ADD influxdb-install.sh /influxdb-install.sh
    RUN /bin/bash /influxdb-install.sh

    EXPOSE 8083 8086
    CMD /opt/influxdb/run
    3 changes: 0 additions & 3 deletions goenv
    Original file line number Diff line number Diff line change
    @@ -1,3 +0,0 @@
    export GOROOT=/opt/go
    export GOPATH=/opt/gows
    export PATH=$PATH:$GOPATH/bin:$GOROOT/bin
    38 changes: 38 additions & 0 deletions influxdb-install.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,38 @@
    #!/bin/bash

    echo "deb http://us.archive.ubuntu.com/ubuntu/ precise universe" >> /etc/apt/sources.list
    echo "deb http://us.archive.ubuntu.com/ubuntu/ precise-updates universe" >> /etc/apt/sources.list
    apt-get update
    apt-get -y install wget protobuf-compiler bzr mercurial bison flex g++ make git

    mkdir -p /opt/gows
    cd /opt

    echo <<EOF > /opt/goenv
    export GOROOT=/opt/go
    export GOPATH=/opt/gows
    export PATH=$PATH:$GOPATH/bin:$GOROOT/bin
    EOF

    wget http://go.googlecode.com/files/go1.1.2.linux-amd64.tar.gz
    tar zxvf go1.1.2.linux-amd64.tar.gz
    rm go1.1.2.linux-amd64.tar.gz

    wget https://github.com/influxdb/influxdb/archive/v0.0.7.tar.gz
    tar zxvf v0.0.7.tar.gz
    rm v0.0.7.tar.gz

    ln -s /opt/influxdb-0.0.7 /opt/influxdb
    cd /opt/influxdb

    echo <<EOF > /opt/influxdb/run
    #!/bin/bash
    source /opt/goenv
    cd /opt/influxdb
    ./server
    EOF

    chmod a+x /opt/influxdb/run

    ./build.sh
    6 changes: 0 additions & 6 deletions run
    Original file line number Diff line number Diff line change
    @@ -1,6 +0,0 @@
    #!/bin/bash

    source /opt/goenv
    cd /opt/influxdb

    ./server
  21. smly revised this gist Nov 6, 2013. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion Dockerfile
    Original file line number Diff line number Diff line change
    @@ -14,7 +14,7 @@ RUN rm go1.1.2.linux-amd64.tar.gz
    RUN wget https://github.com/influxdb/influxdb/archive/v0.0.7.tar.gz
    RUN tar zxvf v0.0.7.tar.gz
    RUN rm v0.0.7.tar.gz
    RUN ln -s /opt/influxdb-0.0.7 /ws/influxdb
    RUN ln -s /opt/influxdb-0.0.7 /opt/influxdb
    RUN cd /opt/influxdb
    RUN ./build.sh

  22. smly revised this gist Nov 6, 2013. 1 changed file with 3 additions and 3 deletions.
    6 changes: 3 additions & 3 deletions Dockerfile
    Original file line number Diff line number Diff line change
    @@ -13,9 +13,9 @@ RUN tar zxvf go1.1.2.linux-amd64.tar.gz
    RUN rm go1.1.2.linux-amd64.tar.gz
    RUN wget https://github.com/influxdb/influxdb/archive/v0.0.7.tar.gz
    RUN tar zxvf v0.0.7.tar.gz
    RUN run v0.0.7.tar.gz
    RUN ln -s /ws/influxdb-0.0.7 /ws/influxdb
    RUN cd /ws/influxdb
    RUN rm v0.0.7.tar.gz
    RUN ln -s /opt/influxdb-0.0.7 /ws/influxdb
    RUN cd /opt/influxdb
    RUN ./build.sh

    ADD run /opt/influxdb/run
  23. smly created this gist Nov 6, 2013.
    26 changes: 26 additions & 0 deletions Dockerfile
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,26 @@
    FROM ubuntu
    RUN mkdir -p /opt/gows
    RUN cd /opt
    ADD goenv /opt/goenv

    RUN echo "deb http://us.archive.ubuntu.com/ubuntu/ precise universe" >> /etc/apt/sources.list
    RUN echo "deb http://us.archive.ubuntu.com/ubuntu/ precise-updates universe" >> /etc/apt/sources.list
    RUN apt-get update
    RUN apt-get -y install wget protobuf-compiler bzr mercurial bison flex g++ make git

    RUN wget http://go.googlecode.com/files/go1.1.2.linux-amd64.tar.gz
    RUN tar zxvf go1.1.2.linux-amd64.tar.gz
    RUN rm go1.1.2.linux-amd64.tar.gz
    RUN wget https://github.com/influxdb/influxdb/archive/v0.0.7.tar.gz
    RUN tar zxvf v0.0.7.tar.gz
    RUN run v0.0.7.tar.gz
    RUN ln -s /ws/influxdb-0.0.7 /ws/influxdb
    RUN cd /ws/influxdb
    RUN ./build.sh

    ADD run /opt/influxdb/run

    RUN chmod a+x /opt/influxdb/run

    EXPOSE 8083 8086
    CMD /opt/influxdb/run
    5 changes: 5 additions & 0 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,5 @@
    # Usage

    ````
    $ docker build .
    ````
    3 changes: 3 additions & 0 deletions goenv
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,3 @@
    export GOROOT=/opt/go
    export GOPATH=/opt/gows
    export PATH=$PATH:$GOPATH/bin:$GOROOT/bin
    6 changes: 6 additions & 0 deletions run
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,6 @@
    #!/bin/bash

    source /opt/goenv
    cd /opt/influxdb

    ./server