Commit 1b2c1de2 authored by Furkan Mustafa's avatar Furkan Mustafa

Merge branch '327-fix-tar-split-build-error' into 'dev-0.0.9'

Dockerfile: when building tar-split in base Dockerfile, use a specific version...

Closes #327

See merge request !66
parents 3eddcac2 4ee78aaa
......@@ -98,7 +98,7 @@ publish:oci-image-layout:
script:
- echo http://dl-cdn.alpinelinux.org/alpine/edge/community/ >> /etc/apk/repositories
- apk update
- apk add go=1.13.3-r0
- apk add go=1.13.3-r1
- apk add musl-dev
- go get github.com/coolljt0725/docker2oci
- docker save $CI_REGISTRY_IMAGE:ci-${CI_PIPELINE_ID} | $HOME/go/bin/docker2oci image-layout-${CI_COMMIT_TAG}
......@@ -187,10 +187,13 @@ start_test_services:
# build and copy tar-split
- echo http://dl-cdn.alpinelinux.org/alpine/edge/community/ >> /etc/apk/repositories
- apk update
- apk add go=1.13.3-r0
- apk add go=1.13.3-r1
- apk add musl-dev
- go get -d github.com/vbatts/tar-split/cmd/tar-split
- go build -o $HOME/tar-split -a -ldflags '-extldflags "-static"' $HOME/go/src/github.com/vbatts/tar-split/cmd/tar-split
- apk add git
- git clone https://github.com/vbatts/tar-split.git
- go mod init github.com/vbatts/tar-split/cmd/tar-split
- echo "require github.com/urfave/cli v1.22.1" >> go.mod
- go build -o $HOME/tar-split -a -ldflags '-extldflags "-static"' ./tar-split/cmd/tar-split
- |
for node in beiran1 beiran2 beiran3 beiran4 beiran5 beiran6 beiran7
do
......
FROM golang:1.12.5-stretch AS tar-split-builder
RUN go get -d github.com/vbatts/tar-split/cmd/tar-split
RUN go build -o /tar-split -a -ldflags '-extldflags "-static"' /go/src/github.com/vbatts/tar-split/cmd/tar-split
WORKDIR /opt
RUN git clone https://github.com/vbatts/tar-split.git
RUN go mod init github.com/vbatts/tar-split/cmd/tar-split
RUN echo "require github.com/urfave/cli v1.22.1" >> go.mod
RUN go build -o /tar-split -a -ldflags '-extldflags "-static"' ./tar-split/cmd/tar-split
FROM python:3.6-stretch
LABEL maintainer="info@beiran.io"
......
......@@ -59,17 +59,24 @@ Storage Driver: overlay2
### Install tar-split
beiran's docker plugin needs [tar-split](https://github.com/vbatts/tar-split) now. Please create the binary file and set `tar_split_path`;
beiran's docker plugin needs [tar-split](https://github.com/vbatts/tar-split) now. First, create the binary file:
```
$ git clone https://github.com/vbatts/tar-split.git
$ go mod init github.com/vbatts/tar-split/cmd/tar-split
$ echo "require github.com/urfave/cli v1.22.1" >> go.mod # use an older version of the dependency urfave/cli.
$ go build -o path/to/tar-split -a -ldflags '-extldflags "-static"' ./tar-split/cmd/tar-split
```
Note that the above actions shall be performed outside of `$GOPATH`. And then set `tar_split_path`:
```
$ go get -u github.com/vbatts/tar-split/cmd/tar-split
$ export BEIRAN_PACKAGE_DOCKER_CONFIG='tar_split_path=path/to/tar-split'
```
Or, copy the binary file to the plugin directory (deafult `tar-split_path` is there)
Or, copy the binary file to the plugin directory (deafult `tar-split_path` is there):
```
$ go get github.com/vbatts/tar-split
$ cp path/to/tar-split plugins/beiran_package_docker/
```
......
FROM golang:1.12.5-alpine3.9
LABEL maintainer="info@beiran.io"
RUN apk add git && go get -d github.com/vbatts/tar-split/cmd/tar-split && \
CGO_ENABLED=0 go build -o /tar-split /go/src/github.com/vbatts/tar-split/cmd/tar-split
WORKDIR /opt
RUN apk add git
RUN git clone https://github.com/vbatts/tar-split.git
RUN go mod init github.com/vbatts/tar-split/cmd/tar-split
RUN echo "require github.com/urfave/cli v1.22.1" >> go.mod
RUN go build -o /tar-split -a -ldflags '-extldflags "-static"' ./tar-split/cmd/tar-split
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment