Skip to content

Instantly share code, notes, and snippets.

@mschoch
mschoch / java.Dockerfile
Created December 8, 2013 14:33
Dockerfile for dustin/tiny + java
FROM dustin/tiny
MAINTAINER Marty Schoch "[email protected]"
RUN apt-get update
RUN apt-get install -y openjdk-7-jre-headless
@mschoch
mschoch / elasticsearch.Dockerfile
Last active December 30, 2015 17:19
Dockerfile for elasticsearch
FROM mschoch/java
MAINTAINER Marty Schoch "[email protected]"
# install elasticsearch
ADD https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-1.0.2.deb /tmp/elasticsearch-1.0.2.deb
RUN RUNLEVEL=1 dpkg -i /tmp/elasticsearch-1.0.2.deb
RUN rm /tmp/elasticsearch-1.0.2.deb
ADD https://gist.githubusercontent.com/mschoch/7880523/raw/32c8a2b05ed30335e5558b78ba0729789190b386/elasticsearch-docker-script /usr/share/elasticsearch/bin/elasticsearch-docker
RUN chmod 755 /usr/share/elasticsearch/bin/elasticsearch-docker
@mschoch
mschoch / elasticsearch-docker-script
Last active August 12, 2024 06:31
A script to fix ownership of Elasticsearch data directory (when mounted as a volume in docker), then switch to elasticsearch user and launch elasticsearch
#!/bin/sh
# fix permissions (wrong if docker mounted volume)
chown -R elasticsearch:elasticsearch /var/lib/elasticsearch
# now switch to elasticsearch user and run in foreground
echo Starting: /usr/share/elasticsearch/bin/elasticsearch -Des.default.config=$CONF_FILE -Des.default.path.home=/usr/share/elasticsearch -Des.default.path.logs=$LOG_DIR -Des.default.path.data=/var/lib/elasticsearch -Des.default.path.work=/tmp/elasticsearch -Des.default.path.conf=$CONF_DIR $@
su elasticsearch -s /bin/sh -c "/usr/share/elasticsearch/bin/elasticsearch -Des.default.config=$CONF_FILE -Des.default.path.home=/usr/share/elasticsearch -Des.default.path.logs=$LOG_DIR -Des.default.path.data=/var/lib/elasticsearch -Des.default.path.work=/tmp/elasticsearch -Des.default.path.conf=$CONF_DIR $@"
@mschoch
mschoch / elasticsearch-couchbase-cbugg.Dockerfile
Last active December 30, 2015 20:38
Dockerfile for elasticsearch-couchbase-transport (cbugg build)
FROM mschoch/elasticsearch:1.0.2
MAINTAINER Marty Schoch "[email protected]"
# install elasticsearch-couchbase-transport
RUN /usr/share/elasticsearch/bin/plugin -install transport-couchbase -url http://cbfs-ext.hq.couchbase.com/mschoch/cbugg/elasticsearch-transport-couchbase-2.0.0-SNAPSHOT.zip
# install the couchbase index template
RUN mkdir -p $CONF_DIR/templates
RUN echo '{"couchbase":' >> $CONF_DIR/templates/couchbase.json
RUN cat /usr/share/elasticsearch/plugins/transport-couchbase/couchbase_template.json >> $CONF_DIR/templates/couchbase.json
@mschoch
mschoch / elasticsearch-couchbase.Dockerfile
Last active January 2, 2016 20:59
Dockerfile for elasticsearch-couchbase-transport
FROM mschoch/elasticsearch:0.90.5
MAINTAINER Marty Schoch "[email protected]"
# install elasticsearch-couchbase-transport
RUN /usr/share/elasticsearch/bin/plugin -install transport-couchbase -url http://packages.couchbase.com.s3.amazonaws.com/releases/elastic-search-adapter/1.2.0/elasticsearch-transport-couchbase-1.2.0.zip
# install the couchbase index template
RUN mkdir -p $CONF_DIR/templates
RUN echo '{"couchbase":' >> $CONF_DIR/templates/couchbase.json
RUN cat /usr/share/elasticsearch/plugins/transport-couchbase/couchbase_template.json >> $CONF_DIR/templates/couchbase.json
@mschoch
mschoch / nginx.Dockerfile
Last active January 3, 2016 18:59
Dockerfile for nginx
FROM dustin/tiny
MAINTAINER Marty Schoch "[email protected]"
RUN apt-get update
RUN apt-get install -y nginx
RUN echo "daemon off;" >> /etc/nginx/nginx.conf
EXPOSE 80
CMD /usr/sbin/nginx
@mschoch
mschoch / go.Dockerfile
Last active January 3, 2016 19:59
Dockerfile for dustin/tiny + go
FROM dustin/tiny
MAINTAINER Marty Schoch "[email protected]"
# install some additional compiler/build/dev tools
# not all of these are strictly required
# but they are common enough for things you'll use with go anyway
RUN apt-get update
RUN apt-get install -y netbase gcc g++ make libtool autoconf mercurial git
# build go
@mschoch
mschoch / seriesly.Dockerfile
Last active January 3, 2016 20:09
Dockerfile for seriesly
FROM mschoch/go
MAINTAINER Marty Schoch "[email protected]"
# now install seriesly
RUN go get github.com/dustin/seriesly
EXPOSE 3133
CMD [""]
ENTRYPOINT ["seriesly"]
@mschoch
mschoch / gist:8620930
Created January 25, 2014 18:15
Why does using link argument add alias to source of link?
$ sudo docker run -d mschoch/seriesly
e8588ed6e50380ffd5c5d8eb1cbcf6e313482ccf5e65ba18442a0f60597f5cb8
mschoch@sheltem:~$ sudo docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
e8588ed6e503 mschoch/seriesly:latest seriesly 3 seconds ago Up 3 seconds 3133/tcp elegant_darwin
mschoch@sheltem:~$ sudo docker run -d -link elegant_darwin:seriesly mschoch/nginx
5255604504e77835ebe12706e37c896efc2d92f5d6ad031397eb8a2f1409d626
mschoch@sheltem:~$ sudo docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
5255604504e7 mschoch/nginx:latest /bin/sh -c /usr/sbin 5 seconds ago Up 4 seconds 80/tcp berserk_bardeen
{
"Hostname": "172.23.96.68",
"Database": "db",
"DocSizeDistribution": [
{
"Prob": 20,
"MinSize": 32,
"MaxSize": 127
},
{