-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathDockerfile.dapper
More file actions
52 lines (40 loc) · 1.87 KB
/
Dockerfile.dapper
File metadata and controls
52 lines (40 loc) · 1.87 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
FROM registry.suse.com/bci/golang:1.25
ARG DAPPER_HOST_ARCH
ENV ARCH=$DAPPER_HOST_ARCH
# Proxy configuration
ARG http_proxy
ARG https_proxy
ARG no_proxy
ENV http_proxy $http_proxy
ENV https_proxy $https_proxy
ENV no_proxy $no_proxy
# Configure zypper proxy if https_proxy is set
RUN if [ -n "$https_proxy" ]; then \
PROXY_URL_NO_SCHEME=$(echo "$https_proxy" | sed -e 's#http://##g' -e 's#https://##g'); \
PROXY_HOST=$(echo "$PROXY_URL_NO_SCHEME" | cut -d':' -f1); \
PROXY_PORT=$(echo "$PROXY_URL_NO_SCHEME" | cut -d':' -f2 | cut -d'/' -f1); \
echo "proxy.enabled = true" >> /etc/zypp/zypp.conf; \
echo "proxy.host = $PROXY_HOST" >> /etc/zypp/zypp.conf; \
echo "proxy.port = $PROXY_PORT" >> /etc/zypp/zypp.conf; \
echo "proxy.protocol = http" >> /etc/zypp/zypp.conf; \
echo "Zypper proxy configured to $PROXY_HOST:$PROXY_PORT"; \
else \
echo "No https_proxy set, skipping zypper proxy configuration."; \
fi
# Copy SUSE credentials
COPY SCCcredentials /etc/zypp/credentials.d/SCCcredentials
RUN zypper ref -s && zypper -n update && zypper -n install tar gzip bash git docker less file curl wget
RUN curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/HEAD/install.sh | sh -s latest
# The docker version in dapper is too old to have buildx. Install it manually.
RUN curl -sSfL https://github.com/docker/buildx/releases/download/v0.13.1/buildx-v0.13.1.linux-${ARCH} -o buildx-v0.13.1.linux-${ARCH} && \
chmod +x buildx-v0.13.1.linux-${ARCH} && \
mv buildx-v0.13.1.linux-${ARCH} /usr/local/bin/buildx
## install controller-gen
RUN go install sigs.k8s.io/controller-tools/cmd/controller-gen@v0.17.1
ENV DAPPER_ENV="REPO PUSH TAG DRONE_TAG ARCH"
ENV DAPPER_SOURCE=/go/src/github.com/harvester/vm-dhcp-controller
ENV DAPPER_OUTPUT="./bin ./chart/crds"
ENV DAPPER_DOCKER_SOCKET=true
WORKDIR ${DAPPER_SOURCE}
ENTRYPOINT ["./scripts/entry"]
CMD ["ci"]