Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,21 @@ on:
pull_request:

env:
DOCKERHUB_SLUG: distribution/distribution
DOCKERHUB_SLUG: goharbor/distribution

jobs:
build:
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
fetch-depth: 0
-
name: Docker meta
id: meta
uses: docker/metadata-action@v3
uses: docker/metadata-action@v5
with:
images: |
${{ env.DOCKERHUB_SLUG }}
Expand All @@ -46,10 +46,10 @@ jobs:
org.opencontainers.image.description=The toolkit to pack, ship, store, and deliver container content
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
uses: docker/setup-buildx-action@v3
-
name: Build artifacts
uses: docker/bake-action@v1
uses: docker/bake-action@v5
with:
targets: artifact-all
-
Expand All @@ -58,21 +58,21 @@ jobs:
mv ./bin/**/* ./bin/
-
name: Upload artifacts
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4.3.6
with:
name: registry
path: ./bin/*
if-no-files-found: error
-
name: Login to DockerHub
if: github.event_name != 'pull_request'
uses: docker/login-action@v1
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Build image
uses: docker/bake-action@v1
uses: docker/bake-action@v5
with:
files: |
./docker-bake.hcl
Expand All @@ -81,7 +81,7 @@ jobs:
push: ${{ startsWith(github.ref, 'refs/tags/') }}
-
name: GitHub Release
uses: softprops/action-gh-release@v1
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
with:
draft: true
Expand Down
26 changes: 12 additions & 14 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,46 +5,44 @@ on:
pull_request:

jobs:

build:
runs-on: ubuntu-latest
env:
BUILDTAGS: "include_oss,include_gcs"
CGO_ENABLED: 1
GO111MODULE: "auto"
GOPATH: ${{ github.workspace }}
GOPATH: /home/runner/work/goharbor/distribution
GOOS: linux
COMMIT_RANGE: ${{ github.event_name == 'pull_request' && format('{0}..{1}',github.event.pull_request.base.sha, github.event.pull_request.head.sha) || github.sha }}

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
path: src/github.com/docker/distribution
path: src/github.com/goharbor/distribution
fetch-depth: 50

- name: Set up Go
uses: actions/setup-go@v2
uses: actions/setup-go@v5
with:
go-version: 1.20.10
go-version: 1.23.4

- name: Dependencies
run: |
sudo apt-get -q update
sudo -E apt-get -yq --no-install-suggests --no-install-recommends install python2-minimal
sudo -E apt-get -yq --no-install-suggests --no-install-recommends install python3
cd /tmp && go install github.com/vbatts/git-validation@latest

- name: Build
working-directory: ./src/github.com/docker/distribution
working-directory: ./src/github.com/goharbor/distribution
run: |
DCO_VERBOSITY=-q script/validate/dco
GO111MODULE=on script/setup/install-dev-tools
script/validate/vendor
go build .
make check
make build
#script/validate/vendor
#go build .
#make check
#make build
make binaries
if [ "$GOOS" = "linux" ]; then make coverage ; fi

- uses: codecov/codecov-action@v1
with:
directory: ./src/github.com/docker/distribution
directory: ./src/github.com/goharbor/distribution
34 changes: 17 additions & 17 deletions BUILDING.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ environment.
If a Go development environment is setup, one can use `go get` to install the
`registry` command from the current latest:

go get github.com/docker/distribution/cmd/registry
go get github.com/goharbor/distribution/cmd/registry

The above will install the source repository into the `GOPATH`.

Expand All @@ -43,17 +43,17 @@ The `registry`
binary can then be run with the following:

$ $GOPATH/bin/registry --version
$GOPATH/bin/registry github.com/docker/distribution v2.0.0-alpha.1+unknown
$GOPATH/bin/registry github.com/goharbor/distribution v2.0.0-alpha.1+unknown

> __NOTE:__ While you do not need to use `go get` to checkout the distribution
> project, for these build instructions to work, the project must be checked
> out in the correct location in the `GOPATH`. This should almost always be
> `$GOPATH/src/github.com/docker/distribution`.
> `$GOPATH/src/github.com/goharbor/distribution`.

The registry can be run with the default config using the following
incantation:

$ $GOPATH/bin/registry serve $GOPATH/src/github.com/docker/distribution/cmd/registry/config-example.yml
$ $GOPATH/bin/registry serve $GOPATH/src/github.com/goharbor/distribution/cmd/registry/config-example.yml
INFO[0000] endpoint local-5003 disabled, skipping app.id=34bbec38-a91a-494a-9a3f-b72f9010081f version=v2.0.0-alpha.1+unknown
INFO[0000] endpoint local-8083 disabled, skipping app.id=34bbec38-a91a-494a-9a3f-b72f9010081f version=v2.0.0-alpha.1+unknown
INFO[0000] listening on :5000 app.id=34bbec38-a91a-494a-9a3f-b72f9010081f version=v2.0.0-alpha.1+unknown
Expand All @@ -64,7 +64,7 @@ If it is working, one should see the above log messages.
### Repeatable Builds

For the full development experience, one should `cd` into
`$GOPATH/src/github.com/docker/distribution`. From there, the regular `go`
`$GOPATH/src/github.com/goharbor/distribution`. From there, the regular `go`
commands, such as `go test`, should work per package (please see
[Developing](#developing) if they don't work).

Expand All @@ -87,20 +87,20 @@ build:
github.com/docker/libtrust
...
github.com/yvasiyarov/gorelic
github.com/docker/distribution/registry/handlers
github.com/docker/distribution/cmd/registry
github.com/goharbor/distribution/registry/handlers
github.com/goharbor/distribution/cmd/registry
+ test
...
ok github.com/docker/distribution/digest 7.875s
ok github.com/docker/distribution/manifest 0.028s
ok github.com/docker/distribution/notifications 17.322s
? github.com/docker/distribution/registry [no test files]
ok github.com/docker/distribution/registry/api/v2 0.101s
? github.com/docker/distribution/registry/auth [no test files]
ok github.com/docker/distribution/registry/auth/silly 0.011s
ok github.com/goharbor/distribution/digest 7.875s
ok github.com/goharbor/distribution/manifest 0.028s
ok github.com/goharbor/distribution/notifications 17.322s
? github.com/goharbor/distribution/registry [no test files]
ok github.com/goharbor/distribution/registry/api/v2 0.101s
? github.com/goharbor/distribution/registry/auth [no test files]
ok github.com/goharbor/distribution/registry/auth/silly 0.011s
...
+ /Users/sday/go/src/github.com/docker/distribution/bin/registry
+ /Users/sday/go/src/github.com/docker/distribution/bin/registry-api-descriptor-template
+ /Users/sday/go/src/github.com/goharbor/distribution/bin/registry
+ /Users/sday/go/src/github.com/goharbor/distribution/bin/registry-api-descriptor-template
+ binaries

The above provides a repeatable build using the contents of the vendor
Expand All @@ -109,7 +109,7 @@ testing and generating tagged binaries. We can verify this worked by running
the registry binary generated in the "./bin" directory:

$ ./bin/registry --version
./bin/registry github.com/docker/distribution v2.0.0-alpha.2-80-g16d8b2c.m
./bin/registry github.com/goharbor/distribution v2.0.0-alpha.2-80-g16d8b2c.m

### Optional build tags

Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ It's mandatory to:

Complying to these simple rules will greatly accelerate the review process, and will ensure you have a pleasant experience in contributing code to the Registry.

Have a look at a great, successful contribution: the [Swift driver PR](https://github.com/docker/distribution/pull/493)
Have a look at a great, successful contribution: the [Swift driver PR](https://github.com/goharbor/distribution/pull/493)

## Coding Style

Expand Down
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ COPY --from=xx / /
RUN apk add --no-cache bash coreutils file git
ENV GO111MODULE=auto
ENV CGO_ENABLED=0
WORKDIR /go/src/github.com/docker/distribution
WORKDIR /go/src/github.com/goharbor/distribution

FROM base AS version
ARG PKG="github.com/docker/distribution"
ARG PKG="github.com/goharbor/distribution"
RUN --mount=target=. \
VERSION=$(git describe --match 'v[0-9]*' --dirty='.m' --always --tags) REVISION=$(git rev-parse HEAD)$(if ! git diff --no-ext-diff --quiet --exit-code; then echo .m; fi); \
echo "-X ${PKG}/version.Version=${VERSION#v} -X ${PKG}/version.Revision=${REVISION} -X ${PKG}/version.Package=${PKG}" | tee /tmp/.ldflags; \
Expand All @@ -23,7 +23,7 @@ FROM base AS build
ARG TARGETPLATFORM
ARG LDFLAGS="-s -w"
ARG BUILDTAGS="include_oss,include_gcs"
RUN --mount=type=bind,target=/go/src/github.com/docker/distribution,rw \
RUN --mount=type=bind,target=/go/src/github.com/goharbor/distribution,rw \
--mount=type=cache,target=/root/.cache/go-build \
--mount=target=/go/pkg/mod,type=cache \
--mount=type=bind,source=/tmp/.ldflags,target=/tmp/.ldflags,from=version \
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ VERSION=$(shell git describe --match 'v[0-9]*' --dirty='.m' --always)
REVISION=$(shell git rev-parse HEAD)$(shell if ! git diff --no-ext-diff --quiet --exit-code; then echo .m; fi)


PKG=github.com/docker/distribution
PKG=github.com/goharbor/distribution

# Project packages.
PACKAGES=$(shell go list -tags "${BUILDTAGS}" ./... | grep -v /vendor/)
Expand Down Expand Up @@ -50,7 +50,7 @@ version/version.go:

check: ## run all linters (TODO: enable "unused", "varcheck", "ineffassign", "unconvert", "staticheck", "goimports", "structcheck")
@echo "$(WHALE) $@"
@GO111MODULE=off golangci-lint --build-tags "${BUILDTAGS}" run
@GO111MODULE=off golangci-lint --build-tags "${BUILDTAGS}" run --skip-files ".*_test.go"

test: ## run tests, except integration test with test.short
@echo "$(WHALE) $@"
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ project with a new API design, focused around security and performance.
<img src="https://www.docker.com/sites/default/files/oyster-registry-3.png" width=200px/>

[![Circle CI](https://circleci.com/gh/docker/distribution/tree/master.svg?style=svg)](https://circleci.com/gh/docker/distribution/tree/master)
[![GoDoc](https://godoc.org/github.com/docker/distribution?status.svg)](https://godoc.org/github.com/docker/distribution)
[![GoDoc](https://godoc.org/github.com/goharbor/distribution?status.svg)](https://godoc.org/github.com/goharbor/distribution)

This repository contains the following components:

|**Component** |Description |
|--------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **registry** | An implementation of the [Docker Registry HTTP API V2](docs/spec/api.md) for use with docker 1.6+. |
| **libraries** | A rich set of libraries for interacting with distribution components. Please see [godoc](https://godoc.org/github.com/docker/distribution) for details. **Note**: These libraries are **unstable**. |
| **libraries** | A rich set of libraries for interacting with distribution components. Please see [godoc](https://godoc.org/github.com/goharbor/distribution) for details. **Note**: These libraries are **unstable**. |
| **specifications** | _Distribution_ related specifications are available in [docs/spec](docs/spec) |
| **documentation** | Docker's full documentation set is available at [docs.docker.com](https://docs.docker.com). This repository [contains the subset](docs/) related just to the registry. |

Expand Down Expand Up @@ -103,7 +103,7 @@ avenues are available for support:
Issue Tracker
</th>
<td>
github.com/docker/distribution/issues
github.com/goharbor/distribution/issues
</td>
</tr>
<tr>
Expand Down
14 changes: 7 additions & 7 deletions ROADMAP.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ considerations made in respect of the future of the project.

## Distribution Components

Components of the Distribution Project are managed via github [milestones](https://github.com/docker/distribution/milestones). Upcoming
Components of the Distribution Project are managed via github [milestones](https://github.com/goharbor/distribution/milestones). Upcoming
features and bugfixes for a component will be added to the relevant milestone. If a feature or
bugfix is not part of a milestone, it is currently unscheduled for
implementation.
Expand All @@ -39,7 +39,7 @@ implementation.
The new Docker registry is the main portion of the distribution repository.
Registry 2.0 is the first release of the next-generation registry. This was
primarily focused on implementing the [new registry
API](https://github.com/docker/distribution/blob/master/docs/spec/api.md),
API](https://github.com/goharbor/distribution/blob/master/docs/spec/api.md),
with a focus on security and performance.

Following from the Distribution project goals above, we have a set of goals
Expand Down Expand Up @@ -145,7 +145,7 @@ process. Once this has been explored, we integrate with the docker client.

Please see the following for more detail:

- https://github.com/docker/distribution/issues/206
- https://github.com/goharbor/distribution/issues/206

##### Deletes

Expand Down Expand Up @@ -243,9 +243,9 @@ very cheap disk space for a complex deployment and operational story.

Please see the following issues for more detail:

- https://github.com/docker/distribution/issues/422
- https://github.com/docker/distribution/issues/461
- https://github.com/docker/distribution/issues/462
- https://github.com/goharbor/distribution/issues/422
- https://github.com/goharbor/distribution/issues/461
- https://github.com/goharbor/distribution/issues/462

### Distribution Package

Expand All @@ -263,5 +263,5 @@ just the registry.

### Project Planning

An [Open-Source Planning Process](https://github.com/docker/distribution/wiki/Open-Source-Planning-Process) is used to define the Roadmap. [Project Pages](https://github.com/docker/distribution/wiki) define the goals for each Milestone and identify current progress.
An [Open-Source Planning Process](https://github.com/goharbor/distribution/wiki/Open-Source-Planning-Process) is used to define the Roadmap. [Project Pages](https://github.com/goharbor/distribution/wiki) define the goals for each Milestone and identify current progress.

4 changes: 1 addition & 3 deletions cmd/digest/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,9 @@ import (
"log"
"os"

"github.com/docker/distribution/version"
"github.com/opencontainers/go-digest"

_ "crypto/sha256"
_ "crypto/sha512"
"github.com/goharbor/distribution/version"
)

var (
Expand Down
4 changes: 2 additions & 2 deletions cmd/registry-api-descriptor-template/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ import (
"regexp"
"text/template"

"github.com/docker/distribution/registry/api/errcode"
v2 "github.com/docker/distribution/registry/api/v2"
"github.com/goharbor/distribution/registry/api/errcode"
v2 "github.com/goharbor/distribution/registry/api/v2"
)

var spaceRegex = regexp.MustCompile(`\n\s*`)
Expand Down
28 changes: 14 additions & 14 deletions cmd/registry/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,20 @@ package main
import (
_ "net/http/pprof"

"github.com/docker/distribution/registry"
_ "github.com/docker/distribution/registry/auth/htpasswd"
_ "github.com/docker/distribution/registry/auth/silly"
_ "github.com/docker/distribution/registry/auth/token"
_ "github.com/docker/distribution/registry/proxy"
_ "github.com/docker/distribution/registry/storage/driver/azure"
_ "github.com/docker/distribution/registry/storage/driver/filesystem"
_ "github.com/docker/distribution/registry/storage/driver/gcs"
_ "github.com/docker/distribution/registry/storage/driver/inmemory"
_ "github.com/docker/distribution/registry/storage/driver/middleware/cloudfront"
_ "github.com/docker/distribution/registry/storage/driver/middleware/redirect"
_ "github.com/docker/distribution/registry/storage/driver/oss"
_ "github.com/docker/distribution/registry/storage/driver/s3-aws"
_ "github.com/docker/distribution/registry/storage/driver/swift"
"github.com/goharbor/distribution/registry"
_ "github.com/goharbor/distribution/registry/auth/htpasswd"
_ "github.com/goharbor/distribution/registry/auth/silly"
_ "github.com/goharbor/distribution/registry/auth/token"
_ "github.com/goharbor/distribution/registry/proxy"
_ "github.com/goharbor/distribution/registry/storage/driver/azure"
_ "github.com/goharbor/distribution/registry/storage/driver/filesystem"
_ "github.com/goharbor/distribution/registry/storage/driver/gcs"
_ "github.com/goharbor/distribution/registry/storage/driver/inmemory"
_ "github.com/goharbor/distribution/registry/storage/driver/middleware/cloudfront"
_ "github.com/goharbor/distribution/registry/storage/driver/middleware/redirect"
_ "github.com/goharbor/distribution/registry/storage/driver/oss"
_ "github.com/goharbor/distribution/registry/storage/driver/s3-aws"
_ "github.com/goharbor/distribution/registry/storage/driver/swift"
)

func main() {
Expand Down
Loading
Loading