Joey Armstrong | 9fadcbe | 2024-01-17 19:00:37 -0500 | [diff] [blame] | 1 | # Copyright 2018-2024 Open Networking Foundation (ONF) and the ONF Contributors |
Scott Baker | 60e570d | 2020-02-02 22:10:13 -0800 | [diff] [blame] | 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 | |
Joey Armstrong | 4f21875 | 2024-07-29 16:04:36 -0400 | [diff] [blame] | 15 | FROM busybox:stable-glibc |
Scott Baker | 60e570d | 2020-02-02 22:10:13 -0800 | [diff] [blame] | 16 | |
| 17 | RUN mkdir -p /usr/bin |
Joey Armstrong | 9684bea | 2023-07-19 12:04:09 -0400 | [diff] [blame] | 18 | |
| 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 | # ------------------------------------------------------------------- |
Joey Armstrong | 4f21875 | 2024-07-29 16:04:36 -0400 | [diff] [blame] | 28 | # RUN wget -O - https://github.com/opencord/voltctl/releases/download/v1.9.1/voltctl-1.9.1-linux-amd64 |
Joey Armstrong | 9684bea | 2023-07-19 12:04:09 -0400 | [diff] [blame] | 29 | |
| 30 | # https://github.com/opencord/voltctl/releases/download/untagged-cd611c39178f25b95a87/voltctl-1.9.1-linux-amd64 |
| 31 | |
Joey Armstrong | 4f21875 | 2024-07-29 16:04:36 -0400 | [diff] [blame] | 32 | RUN wget -q --no-check-certificate\ |
Joey Armstrong | 9684bea | 2023-07-19 12:04:09 -0400 | [diff] [blame] | 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 | ## ----------------------------------------------------- |
| 45 | RUN chmod a+x /usr/bin/voltctl.tmp && sync |
| 46 | # RUN /usr/bin/voltctl.tmp --version |
Scott Baker | 60e570d | 2020-02-02 22:10:13 -0800 | [diff] [blame] | 47 | COPY volt.config /root/.volt/config |
Joey Armstrong | 9684bea | 2023-07-19 12:04:09 -0400 | [diff] [blame] | 48 | RUN mv -vf /usr/bin/voltctl.tmp /usr/bin/voltctl |
| 49 | RUN /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 Windlass | b1ec7d0 | 2021-02-22 16:24:10 +0530 | [diff] [blame] | 59 | CMD ["sh", "-c", "sleep infinity"] |
Joey Armstrong | 9684bea | 2023-07-19 12:04:09 -0400 | [diff] [blame] | 60 | |
| 61 | # [EOF] |