Skip to content

Commit 9f95f29

Browse files
authored
Merge pull request #17 from infosiftr/go-dockerlibrary
Merge github.com/docker-library/go-dockerlibrary into bashbrew
2 parents 818df5f + 143301c commit 9f95f29

33 files changed

+1723
-18
lines changed

.dockerignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
**
2+
!architecture/
23
!bashbrew.sh
34
!cmd/
45
!go.mod
56
!go.sum
7+
!manifest/
8+
!pkg/
69
!scripts/

.github/workflows/ci.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,14 @@ jobs:
2727
bin/bashbrew list --uniq "$image"
2828
bin/bashbrew cat "$image"
2929
bin/bashbrew from --uniq "$image"
30+
go-test:
31+
name: Go Test
32+
runs-on: ubuntu-latest
33+
steps:
34+
- uses: actions/checkout@v2
35+
- name: Go Test
36+
run: |
37+
docker build --pull --file Dockerfile.test .
3038
dockerfile:
3139
name: Test Dockerfile
3240
runs-on: ubuntu-latest

Dockerfile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@ WORKDIR /usr/src/bashbrew
1414
COPY go.mod go.sum ./
1515
RUN go mod download; go mod verify
1616

17-
COPY bashbrew.sh ./
18-
COPY cmd cmd
17+
COPY . .
1918
RUN export CGO_ENABLED=0; \
2019
bash -x ./bashbrew.sh --version; \
2120
rm -r ~/.cache/go-build; \

Dockerfile.test

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
FROM golang:1.13-buster
2+
3+
SHELL ["bash", "-Eeuo", "pipefail", "-xc"]
4+
5+
WORKDIR /usr/src/bashbrew
6+
7+
COPY go.mod go.sum ./
8+
RUN go mod download; go mod verify
9+
10+
COPY . .
11+
12+
RUN go test -v -race -coverprofile=coverage.out ./...
13+
14+
RUN go tool cover -func=coverage.out

architecture/oci-platform.go

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
package architecture
2+
3+
// https://github.com/opencontainers/image-spec/blob/v1.0.1/image-index.md#image-index-property-descriptions
4+
// see "platform" (under "manifests")
5+
type OCIPlatform struct {
6+
OS string `json:"os"`
7+
Architecture string `json:"architecture"`
8+
Variant string `json:"variant,omitempty"`
9+
10+
//OSVersion string `json:"os.version,omitempty"`
11+
//OSFeatures []string `json:"os.features,omitempty"`
12+
}
13+
14+
var SupportedArches = map[string]OCIPlatform{
15+
"amd64": {OS: "linux", Architecture: "amd64"},
16+
"arm32v5": {OS: "linux", Architecture: "arm", Variant: "v5"},
17+
"arm32v6": {OS: "linux", Architecture: "arm", Variant: "v6"},
18+
"arm32v7": {OS: "linux", Architecture: "arm", Variant: "v7"},
19+
"arm64v8": {OS: "linux", Architecture: "arm64", Variant: "v8"},
20+
"i386": {OS: "linux", Architecture: "386"},
21+
"mips64le": {OS: "linux", Architecture: "mips64le"},
22+
"ppc64le": {OS: "linux", Architecture: "ppc64le"},
23+
"s390x": {OS: "linux", Architecture: "s390x"},
24+
25+
"windows-amd64": {OS: "windows", Architecture: "amd64"},
26+
}

cmd/bashbrew/cmd-cat.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ import (
88
"text/template"
99

1010
"github.com/codegangsta/cli"
11-
"github.com/docker-library/go-dockerlibrary/manifest"
12-
"github.com/docker-library/go-dockerlibrary/pkg/templatelib"
11+
"github.com/docker-library/bashbrew/manifest"
12+
"github.com/docker-library/bashbrew/pkg/templatelib"
1313
)
1414

1515
var DefaultCatFormat = `

cmd/bashbrew/cmd-deps.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import (
88
"github.com/codegangsta/cli"
99
"pault.ag/go/topsort"
1010

11-
"github.com/docker-library/go-dockerlibrary/manifest"
11+
"github.com/docker-library/bashbrew/manifest"
1212
)
1313

1414
func cmdOffspring(c *cli.Context) error {

cmd/bashbrew/cmd-list.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import (
55
"path"
66

77
"github.com/codegangsta/cli"
8-
"github.com/docker-library/go-dockerlibrary/manifest"
8+
"github.com/docker-library/bashbrew/manifest"
99
)
1010

1111
func cmdList(c *cli.Context) error {

cmd/bashbrew/cmd-put-shared.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ import (
99

1010
"github.com/codegangsta/cli"
1111

12-
"github.com/docker-library/go-dockerlibrary/architecture"
13-
"github.com/docker-library/go-dockerlibrary/manifest"
12+
"github.com/docker-library/bashbrew/architecture"
13+
"github.com/docker-library/bashbrew/manifest"
1414
)
1515

1616
func entriesToManifestToolYaml(singleArch bool, r Repo, entries ...*manifest.Manifest2822Entry) (string, time.Time, int, error) {

cmd/bashbrew/config.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import (
99
"strings"
1010

1111
"github.com/codegangsta/cli"
12-
"github.com/docker-library/go-dockerlibrary/pkg/stripper"
12+
"github.com/docker-library/bashbrew/pkg/stripper"
1313
"pault.ag/go/debian/control"
1414
)
1515

0 commit comments

Comments
 (0)