Browse Source

Publish docker image (#11)

* setup_remote_docker

* Go back to plain golang

* persist to workspace

* Faster iteration

* Add bin/liche to alpine

* Path

* Use Dockerfile.test
renovate/configure
iamdanfox 7 years ago
committed by Yota Toyama
parent
commit
dd99579af4
  1. 20
      .circleci/config.yml
  2. 10
      Dockerfile
  3. 7
      Dockerfile.test
  4. 2
      rakefile.rb

20
.circleci/config.yml

@ -1,11 +1,13 @@
version: 2 version: 2
jobs: jobs:
build: build:
docker: docker:
- image: golang - image: golang
working_directory: /go/src/github.com/raviqqe/liche working_directory: /go/src/github.com/raviqqe/liche
steps: steps:
- checkout - checkout
- setup_remote_docker
- run: - run:
name: Setup name: Setup
command: | command: |
@ -32,3 +34,21 @@ jobs:
- run: - run:
name: Install name: Install
command: rake install command: rake install
- persist_to_workspace:
root: .
paths: [ bin/liche, Dockerfile.test ]
docker:
docker:
- image: docker:17.05.0-ce-git
steps:
- attach_workspace: { at: . }
- setup_remote_docker
- run: docker build -f Dockerfile.test -t raviqqe/docker-liche:latest .
workflows:
version: 2
build:
jobs:
- build
- docker: { requires: [ build ] }

10
Dockerfile

@ -0,0 +1,10 @@
FROM golang:latest
RUN CGO_ENABLED=0 GOOS=linux go get -u github.com/raviqqe/liche
FROM alpine:latest
RUN apk --no-cache add ca-certificates
WORKDIR /root/
COPY --from=0 /go/bin/liche /go/bin/liche
ENV PATH "/go/bin:$PATH"
RUN liche --help
CMD liche

7
Dockerfile.test

@ -0,0 +1,7 @@
FROM alpine:latest
RUN apk --no-cache add ca-certificates
WORKDIR /root/
ADD bin/liche /go/bin/liche
ENV PATH "/go/bin:$PATH"
RUN liche --help
CMD liche

2
rakefile.rb

@ -9,7 +9,7 @@ task :deps do
end end
task :build do task :build do
sh 'go build -o bin/liche' sh 'CGO_ENABLED=0 GOOS=linux go build -o bin/liche'
end end
task :fast_unit_test do task :fast_unit_test do

Loading…
Cancel
Save