Skip to content

Commit

Permalink
golang: 1.16.x (rancher#689)
Browse files Browse the repository at this point in the history
Signed-off-by: Jacob Blain Christen <[email protected]>
  • Loading branch information
dweomer authored May 4, 2021
1 parent 4e18173 commit 63341b3
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 19 deletions.
18 changes: 4 additions & 14 deletions Dockerfile.dapper
Original file line number Diff line number Diff line change
@@ -1,29 +1,19 @@
FROM golang:1.13-alpine
FROM golang:1.16-alpine

ARG DAPPER_HOST_ARCH
ENV ARCH $DAPPER_HOST_ARCH

RUN apk -U add bash git gcc musl-dev docker vim less file curl wget ca-certificates
RUN go get -d golang.org/x/lint/golint && \
git -C /go/src/golang.org/x/lint/golint checkout -b current 06c8688daad7faa9da5a0c2f163a3d14aac986ca && \
go install golang.org/x/lint/golint && \
rm -rf /go/src /go/pkg
RUN if [ "${ARCH}" == "amd64" ]; then \
curl -sL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s v1.27.0; \
RUN if [ "$(go env GOARCH)" = "arm64" ]; then \
curl -sL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s v1.38.0; \
fi

RUN go get -d github.com/rancher/trash && \
git -C /go/src/github.com/rancher/trash checkout -b current v0.2.6 && \
go install github.com/rancher/trash && \
rm -rf /go/src /go/pkg

ENV DAPPER_RUN_ARGS --privileged -v /tmp:/tmp -v k3os-pkg:/go/pkg -v k3os-cache:/root/.cache/go-build
ENV DAPPER_ENV REPO TAG DRONE_TAG
ENV DAPPER_SOURCE /go/src/github.com/rancher/k3os/
ENV DAPPER_OUTPUT ./build ./dist
ENV DAPPER_DOCKER_SOCKET true
ENV TRASH_CACHE ${DAPPER_SOURCE}/.trash-cache
ENV HOME ${DAPPER_SOURCE}
WORKDIR ${DAPPER_SOURCE}
ENV GO111MODULE off
ENTRYPOINT ["./scripts/entry"]
CMD ["ci"]
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/rancher/k3os

go 1.13
go 1.16

require (
github.com/docker/docker v1.13.1
Expand Down
2 changes: 1 addition & 1 deletion images/10-gobuild/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.13-alpine AS gobuild
FROM golang:1.16-alpine AS gobuild
RUN apk -U add git gcc linux-headers musl-dev make libseccomp libseccomp-dev bash
COPY gobuild /usr/bin/
RUN rm -f /bin/sh && ln -s /bin/bash /bin/sh
Expand Down
6 changes: 4 additions & 2 deletions images/20-progs/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,21 @@ FROM ${REPO}/k3os-gobuild:${TAG} as gobuild
ENV LINUXKIT v0.8

FROM gobuild as linuxkit
ENV GO111MODULE off
RUN git clone https://github.com/linuxkit/linuxkit.git $GOPATH/src/github.com/linuxkit/linuxkit
WORKDIR $GOPATH/src/github.com/linuxkit/linuxkit/pkg/metadata
RUN git checkout -b current $LINUXKIT
RUN gobuild -o /output/metadata

FROM gobuild as k3os
ARG VERSION
# COPY /cmd/ $GOPATH/src/github.com/rancher/k3os/cmd/
COPY go.mod $GOPATH/src/github.com/rancher/k3os/
COPY go.sum $GOPATH/src/github.com/rancher/k3os/
COPY /pkg/ $GOPATH/src/github.com/rancher/k3os/pkg/
COPY /main.go $GOPATH/src/github.com/rancher/k3os/
COPY /vendor/ $GOPATH/src/github.com/rancher/k3os/vendor/
WORKDIR $GOPATH/src/github.com/rancher/k3os
RUN gobuild -o /output/k3os
RUN gobuild -mod=readonly -o /output/k3os

FROM gobuild
COPY --from=linuxkit /output/ /output/
Expand Down
2 changes: 1 addition & 1 deletion scripts/run-qemu
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ fi
# ./scripts/run-qemu k3os.mode=live

## silent install
# DISK_NAME=test.img ./scripts/run-qemu k3os.password=rancher k3os.mode=install k3os.install.silent k3os.install.device=/dev/vda
# DISK_NAME=test.img ./scripts/run-qemu k3os.mode=install k3os.install.silent k3os.install.device=/dev/vda k3os.install.power_off=true

## run installed vm
# DISK_NAME=test.img ./scripts/run-qemu k3os.password=rancher
Expand Down

0 comments on commit 63341b3

Please sign in to comment.