Skip to content
This repository has been archived by the owner on Mar 25, 2022. It is now read-only.

golang1.5 for IPFS and Pinbot #103

Merged
3 commits merged into from
Oct 23, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions solarnet/roles/ipfs/files/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
FROM golang:1.4
MAINTAINER Brian Tiger Chow <btc@perfmode.com>
FROM golang:1.5.1
MAINTAINER Lars Gierth <larsg@systemli.org>

# This IPFS repo should be copied into ./go-ipfs
ADD go-ipfs /go/src/github.com/ipfs/go-ipfs
ADD . /go/src/github.com/ipfs/go-ipfs

RUN cd /go/src/github.com/ipfs/go-ipfs/cmd/ipfs && go install

Expand Down
27 changes: 13 additions & 14 deletions solarnet/roles/ipfs/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,22 @@
---
# build the docker image, if needed
- shell: "docker images -a | grep {{ ipfs_ref }}"
- shell: "cat /opt/ipfs.ref | grep {{ ipfs_ref }}"
ignore_errors: true
register: ipfs_image_present
- file:
path: /ipfs_build
state: directory
when: "ipfs_image_present.rc != 0"
- copy:
src: Dockerfile
dest: /ipfs_build/Dockerfile
when: "ipfs_image_present.rc != 0"
register: ipfs_ref_present
- git:
repo: https://github.com/ipfs/go-ipfs.git
dest: /ipfs_build/go-ipfs
dest: /opt/ipfs/src
version: "{{ ipfs_ref }}"
when: "ipfs_image_present.rc != 0"
- shell: "docker build -t ipfs:{{ ipfs_ref }} /ipfs_build"
when: "ipfs_image_present.rc != 0"
force: yes
when: "ipfs_ref_present.rc != 0"
- copy:
src: Dockerfile
dest: /opt/ipfs/src/Dockerfile
when: "ipfs_ref_present.rc != 0"
- shell: "docker build -t ipfs:{{ ipfs_ref }} /opt/ipfs/src"
when: "ipfs_ref_present.rc != 0"
- shell: "echo {{ ipfs_ref }} > /opt/ipfs.ref"
when: "ipfs_ref_present.rc != 0"

# generate ipfs repo
- command: "docker run -i -v /ipfs/ipfs_master:/ipfs ipfs:{{ ipfs_ref }} sh -c 'IPFS_PATH=/ipfs/repo ipfs init'"
Expand Down
10 changes: 3 additions & 7 deletions solarnet/roles/pinbot/files/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,18 +1,14 @@
FROM alpine:3.2
FROM golang:1.5.1
MAINTAINER Lars Gierth <larsg@systemli.org>

ENV GOPATH=/go \
REPO_PATH=github.com/whyrusleeping/pinbot
COPY . $GOPATH/src/$REPO_PATH

RUN apk add --update go git \
&& apk add -u musl \
&& go get github.com/whyrusleeping/hellabot \
RUN go get github.com/whyrusleeping/hellabot \
&& go get github.com/whyrusleeping/ipfs-shell \
&& cd $GOPATH/src/$REPO_PATH \
&& go build -o /bin/pinbot $REPO_PATH \
&& rm -rf $GOPATH /var/cache/apk/* \
&& apk del --purge go git
&& go build -o /bin/pinbot $REPO_PATH

VOLUME [ "/pinbot" ]
WORKDIR /pinbot
Expand Down