You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Update heighliner logic to get latest apline version for any given version of go that the chain(s) are using.
Locations of interest : builder.go & go_versions.go files
If the latest alpine is not retrievable using this , then use the alpine version provided by the buildconfig of the chain.
Example in python.
import requests
def get_latest_alpine_tag(go_version):
# Docker Hub API endpoint for the Go repository
url = "https://hub.docker.com/v2/repositories/library/golang/tags/"
# Initialize variables for pagination
page = 1
tags = []
while True:
# Make the API request with pagination parameters
params = {"page": page, "page_size": 100}
response = requests.get(url, params=params)
# Check if the request was successful
if response.status_code == 200:
# Parse the JSON response
data = response.json()
# Extract the tags from the current page
page_tags = [tag["name"] for tag in data["results"]]
# Filter the tags that match the desired Go version
filtered_tags = [tag for tag in page_tags if tag.startswith(go_version)]
# Add the filtered tags to the list of all tags
tags.extend(filtered_tags)
# Check if there are more pages
if data["next"] is None:
break
# Increment the page number for the next request
page += 1
else:
print("Failed to retrieve tags from Docker Hub.")
return None
# Filter the tags to find the ones with the Alpine version
alpine_tags = [tag for tag in tags if "alpine" in tag]
# Sort the Alpine versions to determine the latest one
latest_alpine_tag = max(alpine_tags, key=lambda x: x.split("-")[1]) if alpine_tags else None
return latest_alpine_tag
# Example usage
go_version = "1.17"
latest_tag = get_latest_alpine_tag(go_version)
if latest_tag:
print(f"Latest Alpine tag for Go {go_version}: {latest_tag}")
else:
print("No Alpine tag found for the specified Go version.")
The text was updated successfully, but these errors were encountered:
jonathanpberger
changed the title
Update builder to use the latest alpine version of go release(s) using dockerhubapi.
Builder should use latest alpine version of go release(s) using dockerhubapi.
Apr 10, 2024
jonathanpberger
changed the title
Builder should use latest alpine version of go release(s) using dockerhubapi.
Builder should use latest alpine version of go release(s) using dockerhubapi.
Apr 10, 2024
Go version from go.mod: 1.22.4, will build with version: 1.22.4 image: 1.22.4-alpine3.18
Building image from current working directory source, resulting docker image tags: +[manifest:local]
Step 1/51 : ARG BASE_VERSION
Step 2/51 : FROM golang:${BASE_VERSION} AS init-env
error building docker image for manifest from ref: - manifest for golang:1.22.4-alpine3.18 not found: manifest unknown: manifest unknown
Update heighliner logic to get latest apline version for any given version of go that the chain(s) are using.
Locations of interest : builder.go & go_versions.go files
If the latest alpine is not retrievable using this , then use the alpine version provided by the buildconfig of the chain.
Example in python.
The text was updated successfully, but these errors were encountered: