Skip to content

Commit

Permalink
use VOLUME in final service images, improved readme
Browse files Browse the repository at this point in the history
  • Loading branch information
darklynx committed Jul 19, 2016
1 parent 5305359 commit e4003c0
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 10 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ To build minimalistic image based on `alpine` image (final size is ~15 Mb) simpl
$ ./docker/minimal/build.sh
```

See `docker/` folder for alternative docker builds.
See [docker folder](./docker) for alternative docker builds.

### Run container as a service

Expand Down
13 changes: 13 additions & 0 deletions docker/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Docker Scripts

## Overview

```bash
$ docker images

REPOSITORY TAG IMAGE ID CREATED SIZE
request-baskets ubuntu 86d1c3b87154 53 seconds ago 378.8 MB
request-baskets alpine 7991c7cec214 6 minutes ago 15.2 MB
request-baskets golang 8fe4269dbc19 7 minutes ago 768.4 MB
...
```
3 changes: 1 addition & 2 deletions docker/minimal/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@ FROM alpine

MAINTAINER Vladimir L, vladimir_l@gmx.net

# Create a volume for rbaskets service
# Create a volume for request-baskets service data folder
VOLUME /var/lib/rbaskets
# RUN mkdir -p /var/lib/rbaskets

# Copy built service
COPY request-baskets /usr/local/bin/
Expand Down
2 changes: 1 addition & 1 deletion docker/minimal/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ cd "$(dirname "$0")"
docker run --rm -v "$PWD":/go/bin --env CGO_ENABLED=0 golang:latest go get -v github.com/darklynx/request-baskets

# create a minimalistic docker image (based on alpine) with service only
docker build -t request-baskets .
docker build -t request-baskets:alpine .

# cleanup
rm request-baskets
Expand Down
9 changes: 3 additions & 6 deletions docker/ubuntu/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ FROM ubuntu

MAINTAINER Vladimir L, vladimir_l@gmx.net

# Create a volume for rbaskets service (uncomment if backups are required)
#VOLUME /var/lib/rbaskets
# Create a volume for request-baskets service data folder
VOLUME /var/lib/rbaskets

# One liner:
# - Install golang & git
Expand All @@ -19,11 +19,8 @@ RUN set -x \
&& export GOPATH="$(mktemp -d)" \
&& go get github.com/darklynx/request-baskets \
&& cp "$GOPATH/bin/request-baskets" /usr/local/bin/ \
&& mkdir -p /var/lib/rbaskets \
&& rm -rf "$GOPATH" \
&& apt-get purge --auto-remove -y git golang-go \
&& apt-get autoclean -y \
&& apt-get autoremove -y
&& apt-get purge --auto-remove -y git golang-go

# Expose ports
EXPOSE 55555
Expand Down

0 comments on commit e4003c0

Please sign in to comment.