Skip to content

Commit 2697595

Browse files
Uses edge repos exclusively (#48)
Signed-off-by: Adrian Cole <[email protected]>
1 parent c331521 commit 2697595

File tree

2 files changed

+14
-33
lines changed

2 files changed

+14
-33
lines changed

Dockerfile

Lines changed: 12 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,6 @@
11
#
2-
# Copyright 2015-2023 The OpenZipkin Authors
3-
#
4-
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
5-
# in compliance with the License. You may obtain a copy of the License at
6-
#
7-
# http://www.apache.org/licenses/LICENSE-2.0
8-
#
9-
# Unless required by applicable law or agreed to in writing, software distributed under the License
10-
# is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
11-
# or implied. See the License for the specific language governing permissions and limitations under
12-
# the License.
2+
# Copyright The OpenZipkin Authors
3+
# SPDX-License-Identifier: Apache-2.0
134
#
145

156
# alpine_version is hard-coded here to allow the following to work:
@@ -23,13 +14,13 @@ ARG alpine_version=3.20.3
2314
# We copy files from the context into a scratch container first to avoid a problem where docker and
2415
# docker-compose don't share layer hashes https://github.com/docker/compose/issues/883 normally.
2516
# COPY --from= works around the issue.
26-
FROM scratch as code
17+
FROM scratch AS code
2718

2819
COPY . /code/
2920

3021
# See from a previously published version to avoid pulling from Docker Hub (docker.io)
3122
# This version is only used to install the real version
32-
FROM ghcr.io/openzipkin/alpine:3.20.2 as install
23+
FROM ghcr.io/openzipkin/alpine:3.20.2 AS install
3324

3425
WORKDIR /code
3526
# Conditions aren't supported in Dockerfile instructions, so we copy source even if it isn't used.
@@ -43,7 +34,7 @@ ENV ALPINE_VERSION=$alpine_version
4334
RUN /code/alpine_minirootfs $ALPINE_VERSION
4435

4536
# Define base layer, notably not adding labels always overridden
46-
FROM scratch as alpine
37+
FROM scratch AS alpine
4738
ARG maintainer="OpenZipkin https://gitter.im/openzipkin/zipkin"
4839
LABEL maintainer=$maintainer
4940
LABEL org.opencontainers.image.authors=$maintainer
@@ -53,9 +44,9 @@ LABEL alpine-version=$alpine_version
5344
COPY --from=install /install /
5445

5546
# Default to UTF-8 file.encoding
56-
ENV LANG en_US.UTF-8
57-
ENV LANGUAGE en_US:en
58-
ENV LC_ALL en_US.UTF-8
47+
ENV LANG=en_US.UTF-8
48+
ENV LANGUAGE=en_US:en
49+
ENV LC_ALL=en_US.UTF-8
5950

6051
# RUN, COPY, and ADD instructions create layers. While layer count is less important in modern
6152
# Docker, it doesn't help performance to intentionally make multiple RUN layers in a base image.
@@ -65,11 +56,10 @@ RUN \
6556
# will throw UnknownHostException as the local hostname isn't in DNS.
6657
echo 'hosts: files mdns4_minimal [NOTFOUND=return] dns mdns4' >> /etc/nsswitch.conf && \
6758
#
68-
# Later installations may require more recent versions of packages such as nodejs
69-
for repository in main testing community; do \
70-
repository_url=https://dl-cdn.alpinelinux.org/alpine/edge/${repository} && \
71-
grep -qF -- ${repository_url} /etc/apk/repositories || echo ${repository_url} >> /etc/apk/repositories; \
72-
done && \
59+
# Exclusively use edge repos to get recent packages, but avoid conflicts with 3.20
60+
echo 'https://dl-cdn.alpinelinux.org/alpine/edge/main' > /etc/apk/repositories && \
61+
echo 'https://dl-cdn.alpinelinux.org/alpine/edge/testing' >> /etc/apk/repositories && \
62+
echo 'https://dl-cdn.alpinelinux.org/alpine/edge/community' >> /etc/apk/repositories && \
7363
#
7464
# Finalize install:
7565
# * java-cacerts: implicitly gets normal ca-certs used outside Java (this does not depend on java)

alpine_minirootfs

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,7 @@
11
#!/bin/sh
22
#
3-
# Copyright 2023 The OpenZipkin Authors
4-
#
5-
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
6-
# in compliance with the License. You may obtain a copy of the License at
7-
#
8-
# http://www.apache.org/licenses/LICENSE-2.0
9-
#
10-
# Unless required by applicable law or agreed to in writing, software distributed under the License
11-
# is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
12-
# or implied. See the License for the specific language governing permissions and limitations under
13-
# the License.
3+
# Copyright The OpenZipkin Authors
4+
# SPDX-License-Identifier: Apache-2.0
145
#
156

167
set -eu

0 commit comments

Comments
 (0)