Skip to content

Commit

Permalink
Merge pull request #577 from nginx-proxy/created
Browse files Browse the repository at this point in the history
feat: add container creation timestamp to RuntimeContainer
  • Loading branch information
buchdag authored Dec 19, 2023
2 parents 8cecc7e + 82ed002 commit 0aff309
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions internal/context/context.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"os"
"regexp"
"sync"
"time"

docker "github.com/fsouza/go-dockerclient"
"github.com/nginx-proxy/docker-gen/internal/utils"
Expand Down Expand Up @@ -91,6 +92,7 @@ type Health struct {

type RuntimeContainer struct {
ID string
Created time.Time
Addresses []Address
Networks []Network
Gateway string
Expand Down
3 changes: 2 additions & 1 deletion internal/generator/generator.go
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,8 @@ func (g *generator) getContainers() ([]*context.RuntimeContainer, error) {

registry, repository, tag := dockerclient.SplitDockerImage(container.Config.Image)
runtimeContainer := &context.RuntimeContainer{
ID: container.ID,
ID: container.ID,
Created: container.Created,
Image: context.DockerImage{
Registry: registry,
Repository: repository,
Expand Down

0 comments on commit 0aff309

Please sign in to comment.