blob: 9931b9ff06fa536e037f61a47a1dcda330f1ce42 [file] [log] [blame]
Scott Baker60e570d2020-02-02 22:10:13 -08001# Copyright 2018-present Open Networking Foundation
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# 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
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14
15FROM busybox:1.31.1-glibc
16
17RUN mkdir -p /usr/bin
Joey Armstrong9684bea2023-07-19 12:04:09 -040018
19# -------------------------------------------------------------------
20# [VOL-5063] - branch==master install latest (tag ?!?)
21# else install release(d) version.
22# -------------------------------------------------------------------
23# https://api.github.com/repos/opencord/voltctl/releases/latest
24# - offers voltctl/releases/download/1.8.45 as released
25# https://github.com/opencord/voltctl/releases
26# - offers v1.9.1 (latest released via build + tagging).
27# -------------------------------------------------------------------
28# RUN wget -O - https://github.com/opencord/voltctl/releases/download/v1.9.1/voltctl-1.9.1-linux-amd64
29
30# https://github.com/opencord/voltctl/releases/download/untagged-cd611c39178f25b95a87/voltctl-1.9.1-linux-amd64
31
32RUN wget -q\
33 -O /usr/bin/voltctl.tmp\
34 https://github.com/opencord/voltctl/releases/download/v1.8.45/voltctl-1.8.45-linux-amd64
35
36## -----------------------------------------------------
37## Maintain a tiny window for rename to avoid contention
38## - Validate download by displaying version
39## - --version not supported by wget binary
40## - Detection and error recovery possible if release
41## binary corrupt or mia but potential for stale
42## command version to silently persist is a larger
43## testing issue so explicitly overwrite.
44## -----------------------------------------------------
45RUN chmod a+x /usr/bin/voltctl.tmp && sync
46# RUN /usr/bin/voltctl.tmp --version
Scott Baker60e570d2020-02-02 22:10:13 -080047COPY volt.config /root/.volt/config
Joey Armstrong9684bea2023-07-19 12:04:09 -040048RUN mv -vf /usr/bin/voltctl.tmp /usr/bin/voltctl
49RUN /usr/bin/voltctl completion bash >> /root/.bashrc
50
51## -----------------------------------------------------------------------
52## Infinite loop -- huh(?!?)
53## Interrogate voltctl startup for status to avoid potential for
54## container accumulation when downstream container shutdown fails.
55## -----------------------------------------------------------------------
56## If sleep is intended to keep the container alive for downstream tasks
57## use handshakes and/or timeouts to avoid long term, idle, resource retention
58## -----------------------------------------------------------------------
Hardik Windlassb1ec7d02021-02-22 16:24:10 +053059CMD ["sh", "-c", "sleep infinity"]
Joey Armstrong9684bea2023-07-19 12:04:09 -040060
61# [EOF]