Skip to content

Commit

Permalink
Revert "Move to BCI"
Browse files Browse the repository at this point in the history
This reverts commit 697222e.
  • Loading branch information
manuelbuil committed Jan 12, 2024
1 parent 697222e commit 186ce0c
Show file tree
Hide file tree
Showing 8 changed files with 64 additions and 13 deletions.
22 changes: 17 additions & 5 deletions .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ platform:
steps:
- name: ci
pull: default
image: rancher/dapper:v0.6.0
image: rancher/dapper:1.11.2
commands:
- dapper ci
- ls -lR build/bin
Expand All @@ -24,6 +24,18 @@ steps:
- pull_request
- tag

- name: stage-binaries
pull: default
image: rancher/dapper:1.11.2
commands:
- "cp -r ./bin/* ./package/"
when:
event:
- tag
ref:
include:
- "refs/tags/*"

- name: github_binary_prerelease
pull: default
image: plugins/github-release
Expand Down Expand Up @@ -105,7 +117,7 @@ platform:
steps:
- name: build
pull: default
image: rancher/dapper:v0.6.0
image: rancher/dapper:1.11.2
commands:
- dapper build
privileged: true
Expand All @@ -119,7 +131,7 @@ steps:

- name: integration-flannel
pull: default
image: rancher/dapper:v0.6.0
image: rancher/dapper:1.11.2
commands:
- dapper integration flannel
privileged: true
Expand All @@ -133,7 +145,7 @@ steps:

- name: integration-calico
pull: default
image: rancher/dapper:v0.6.0
image: rancher/dapper:1.11.2
commands:
- dapper integration calico
privileged: true
Expand All @@ -147,7 +159,7 @@ steps:

- name: integration-weave
pull: default
image: rancher/dapper:v0.6.0
image: rancher/dapper:1.11.2
commands:
- dapper integration weave
privileged: true
Expand Down
21 changes: 18 additions & 3 deletions Dockerfile.dapper
Original file line number Diff line number Diff line change
@@ -1,11 +1,26 @@
FROM registry.suse.com/bci/golang:1.19-20.16
FROM ubuntu:20.04
# FROM arm=armhf/ubuntu:20.04 arm64=arm64v8/ubuntu:20.04

ARG DAPPER_HOST_ARCH
ENV HOST_ARCH=${DAPPER_HOST_ARCH} ARCH=${DAPPER_HOST_ARCH}

RUN zypper -n in docker awk
RUN apt-get update && \
apt-get install -y gcc ca-certificates git wget curl vim less file kmod iptables xz-utils zip && \
rm -f /bin/sh && ln -s /bin/bash /bin/sh

RUN curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s v1.51.1
ENV GOLANG_ARCH_amd64=amd64 GOLANG_ARCH_arm=armv6l GOLANG_ARCH_arm64=arm64 GOLANG_ARCH=GOLANG_ARCH_${ARCH} \
GOPATH=/go PATH=/go/bin:/usr/local/go/bin:${PATH} SHELL=/bin/bash

RUN wget -O - https://storage.googleapis.com/golang/go1.19.3.linux-${!GOLANG_ARCH}.tar.gz | tar -xzf - -C /usr/local

RUN curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s v1.46.2

ENV DOCKER_URL_amd64=https://get.docker.com/builds/Linux/x86_64/docker-1.10.3 \
DOCKER_URL_arm=https://github.com/rancher/docker/releases/download/v1.10.3-ros1/docker-1.10.3_arm \
DOCKER_URL_arm64=https://github.com/rancher/docker/releases/download/v1.10.3-ros1/docker-1.10.3_arm64 \
DOCKER_URL=DOCKER_URL_${ARCH}

RUN wget -O - ${!DOCKER_URL} > /usr/bin/docker && chmod +x /usr/bin/docker

ENV DAPPER_SOURCE /go/src/github.com/rancher/rke/
ENV DAPPER_RUN_ARGS --privileged -v /var/lib/docker
Expand Down
4 changes: 2 additions & 2 deletions dind/dind.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
)

const (
DINDImage = "docker:20.10.23-dind"
DINDImage = "docker:19.03.12-dind"
DINDContainerPrefix = "rke-dind"
DINDPlane = "dind"
DINDNetwork = "dind-network"
Expand Down Expand Up @@ -66,7 +66,7 @@ func StartUpDindContainer(ctx context.Context, dindAddress, dindNetwork, dindSto
"mount --make-shared / && " +
"mount --make-shared /sys && " +
"mount --make-shared /var/lib/docker && " +
"dockerd-entrypoint.sh --tls=false --storage-driver=" + storageDriver,
"dockerd-entrypoint.sh --storage-driver=" + storageDriver,
},
Hostname: dindAddress,
Env: []string{"DOCKER_TLS_CERTDIR="},
Expand Down
3 changes: 3 additions & 0 deletions package/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
FROM ubuntu:20.04
COPY rke /usr/bin/
CMD ["rke"]
20 changes: 20 additions & 0 deletions scripts/package
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,23 @@ SUFFIX=""
[ "${ARCH}" != "amd64" ] && SUFFIX="_${ARCH}"

./scripts/create-releasenote.sh

cd package

TAG=${TAG:-${VERSION}${SUFFIX}}
REPO=${REPO:-rke}

if echo $TAG | grep -q dirty; then
TAG=dev
fi

if [ -n "$DRONE_TAG" ]; then
TAG=$DRONE_TAG
fi

cp ../bin/rke .

IMAGE=${REPO}/rke:${TAG}
docker build -t ${IMAGE} .
echo ${IMAGE} > ../dist/images
echo Built ${IMAGE}
3 changes: 2 additions & 1 deletion scripts/test
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@ echo Running tests

PACKAGES=". $(find -name '*.go' | xargs -I{} dirname {} | cut -f2 -d/ | sort -u | grep -Ev '(^\.$|.git|.trash-cache|vendor|bin)' | sed -e 's!^!./!' -e 's!$!/...!')"

go test -cover -tags=test ${PACKAGES}
[ "${ARCH}" == "amd64" ] && RACE=-race
go test ${RACE} -cover -tags=test ${PACKAGES}

2 changes: 1 addition & 1 deletion types/kdm/zz_generated_deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion types/zz_generated_deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 186ce0c

Please sign in to comment.