Skip to content

Commit

Permalink
sec: Upgrade Ubuntu to latest LTS version (#6992)
Browse files Browse the repository at this point in the history
* sec: Upgrade Ubuntu to latest LTS version

* Upgrade some GitHub workflows to "latest" Ubuntu

---------

Co-authored-by: Paulin Todev <[email protected]>
  • Loading branch information
amontalban and ptodev authored Aug 22, 2024
1 parent c281c76 commit b9c3594
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/check-linux-build-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:

jobs:
check-linux-build-image:
runs-on: ubuntu-22.04
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/trivy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
security-events: write # for github/codeql-action/upload-sarif to upload SARIF results
actions: read # only required for a private repository by github/codeql-action/upload-sarif to get the Action run status
name: Build
runs-on: "ubuntu-20.04"
runs-on: "ubuntu-latest"
steps:
- name: Checkout code
uses: actions/checkout@v4
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ internal API changes are not present.
Main (unreleased)
-----------------

### Other changes

- Change the Docker base image for Linux containers to `ubuntu:noble`. (@amontalban)

v0.42.0 (2024-07-24)
-------------------------

Expand Down
2 changes: 1 addition & 1 deletion cmd/grafana-agent-operator/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ RUN --mount=type=cache,target=/root/.cache/go-build \
RELEASE_BUILD=${RELEASE_BUILD} VERSION=${VERSION} \
make operator

FROM public.ecr.aws/ubuntu/ubuntu:mantic
FROM public.ecr.aws/ubuntu/ubuntu:noble

LABEL org.opencontainers.image.source="https://github.com/grafana/agent"

Expand Down
2 changes: 1 addition & 1 deletion cmd/grafana-agent/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ RUN --mount=type=cache,target=/root/.cache/go-build \
GOEXPERIMENT=${GOEXPERIMENT} \
make agent

FROM public.ecr.aws/ubuntu/ubuntu:mantic
FROM public.ecr.aws/ubuntu/ubuntu:noble

#Username and uid for grafana-agent user
ARG UID=473
Expand Down
2 changes: 1 addition & 1 deletion cmd/grafana-agentctl/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ RUN --mount=type=cache,target=/root/.cache/go-build \
GO_TAGS="netgo promtail_journal_enabled" \
make agentctl

FROM public.ecr.aws/ubuntu/ubuntu:mantic
FROM public.ecr.aws/ubuntu/ubuntu:noble

LABEL org.opencontainers.image.source="https://github.com/grafana/agent"

Expand Down
5 changes: 3 additions & 2 deletions internal/cmd/integration-tests/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ func executeCommand(command string, args []string, taskDescription string) {
cmd := exec.Command(command, args...)
var stderr bytes.Buffer
cmd.Stderr = &stderr

if err := cmd.Run(); err != nil {
log.Fatalf("Error: %s\n", stderr.String())
}
Expand All @@ -39,7 +40,7 @@ func buildAgent() {
}

func setupEnvironment() {
executeCommand("docker-compose", []string{"up", "-d"}, "Setting up environment with Docker Compose")
executeCommand("docker", []string{"compose", "up", "-d"}, "Setting up environment with Docker Compose")
fmt.Println("Sleep for 30 seconds to ensure that the env has time to initialize...")
time.Sleep(30 * time.Second)
}
Expand Down Expand Up @@ -114,7 +115,7 @@ func runAllTests() {

func cleanUpEnvironment() {
fmt.Println("Cleaning up Docker environment...")
err := exec.Command("docker-compose", "down", "--volumes", "--rmi", "all").Run()
err := exec.Command("docker", "compose", "down", "--volumes", "--rmi", "all").Run()
if err != nil {
panic(err)
}
Expand Down

0 comments on commit b9c3594

Please sign in to comment.