Skip to content

Commit

Permalink
Merge pull request #120 from AkihiroSuda/move-repo-to-containerd
Browse files Browse the repository at this point in the history
AkihiroSuda/nerdctl -> containerd/nerdctl
  • Loading branch information
AkihiroSuda committed Mar 18, 2021
2 parents 286bc00 + e2c1098 commit 435f533
Show file tree
Hide file tree
Showing 117 changed files with 350 additions and 383 deletions.
16 changes: 16 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,22 @@ on:
pull_request:

jobs:
project:
name: Project Checks
runs-on: ubuntu-20.04
timeout-minutes: 20
steps:
- uses: actions/setup-go@v2
with:
go-version: 1.16.x
- uses: actions/checkout@v2
with:
path: src/github.com/containerd/nerdctl
fetch-depth: 25
- uses: containerd/project-checks@v1
with:
working-directory: src/github.com/containerd/nerdctl

golangci-lint:
runs-on: ubuntu-20.04
timeout-minutes: 20
Expand Down
25 changes: 20 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
# Copyright The containerd Authors.

# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at

# http://www.apache.org/licenses/LICENSE-2.0

# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# -----------------------------------------------------------------------------
# Usage: `docker run -it --privileged <IMAGE>`. Make sure to add `-t` and `--privileged`.

# Basic deps
Expand Down Expand Up @@ -27,8 +42,8 @@ ARG CONTAINERIZED_SYSTEMD_VERSION=0.1.1

FROM golang:${GO_VERSION}-alpine AS build-minimal
RUN apk add --no-cache make git
COPY . /go/src/github.com/AkihiroSuda/nerdctl
WORKDIR /go/src/github.com/AkihiroSuda/nerdctl
COPY . /go/src/github.com/containerd/nerdctl
WORKDIR /go/src/github.com/containerd/nerdctl
RUN BINDIR=/out/bin make binaries install
# We do not set CMD to `go test` here, because it requires systemd

Expand All @@ -38,7 +53,7 @@ COPY README.md /out/share/doc/nerdctl/
COPY docs /out/share/doc/nerdctl/docs
RUN mkdir -p /out/share/doc/nerdctl-full && \
echo "# nerdctl (full distribution)" > /out/share/doc/nerdctl-full/README.md && \
echo "- nerdctl: $(cd /go/src/github.com/AkihiroSuda/nerdctl && git describe --tags)" >> /out/share/doc/nerdctl-full/README.md
echo "- nerdctl: $(cd /go/src/github.com/containerd/nerdctl && git describe --tags)" >> /out/share/doc/nerdctl-full/README.md
ARG TARGETARCH
ARG CONTAINERD_VERSION
RUN curl -L https://github.com/containerd/containerd/releases/download/v${CONTAINERD_VERSION}/containerd-${CONTAINERD_VERSION}-linux-${TARGETARCH:-amd64}.tar.gz | tar xzvC /out && \
Expand Down Expand Up @@ -138,8 +153,8 @@ COPY --from=goversion /GOVERSION /GOVERSION
ARG TARGETARCH
RUN curl -L https://golang.org/dl/$(cat /GOVERSION).linux-${TARGETARCH:-amd64}.tar.gz | tar xzvC /usr/local
ENV PATH=/usr/local/go/bin:$PATH
COPY . /go/src/github.com/AkihiroSuda/nerdctl
WORKDIR /go/src/github.com/AkihiroSuda/nerdctl
COPY . /go/src/github.com/containerd/nerdctl
WORKDIR /go/src/github.com/containerd/nerdctl
ENV CGO_ENABLED=0
CMD ["go", "test", "-v", "./..."]

Expand Down
4 changes: 4 additions & 0 deletions MAINTAINERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# nerdctl maintainers
#
# As a containerd sub-project, containerd maintainers are also included from https://github.com/containerd/project/blob/master/MAINTAINERS.
# See https://github.com/containerd/project/blob/master/GOVERNANCE.md for description of maintainer role
36 changes: 20 additions & 16 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,23 +1,27 @@
# Copyright (C) The Kubernetes Authors.
# Copyright (C) containerd Authors.
# Copyright (C) nerdctl Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# Copyright The containerd Authors.

# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at

# http://www.apache.org/licenses/LICENSE-2.0

# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# -----------------------------------------------------------------------------
# Portions from https://github.com/kubernetes-sigs/cri-tools/blob/v1.19.0/Makefile
# Copyright The Kubernetes Authors.
# Licensed under the Apache License, Version 2.0
# -----------------------------------------------------------------------------

GO ?= go


PACKAGE := github.com/AkihiroSuda/nerdctl
PACKAGE := github.com/containerd/nerdctl
BINDIR ?= /usr/local/bin

VERSION=$(shell git describe --match 'v[0-9]*' --dirty='.m' --always --tags)
Expand Down
15 changes: 12 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[[⬇️ **Download]**](https://github.com/AkihiroSuda/nerdctl/releases)
[[⬇️ **Download]**](https://github.com/containerd/nerdctl/releases)
[[📖 **Command reference]**](#command-reference)
[[📚 **Additional documents]**](#additional-documents)

Expand All @@ -14,6 +14,8 @@

✅ Supports [encrypted images (ocicrypt)](./docs/ocicrypt.md)

nerdctl is a **non-core** sub-project of containerd.

## Examples

### Basic usage
Expand Down Expand Up @@ -51,7 +53,7 @@ $ nerdctl run -d -p 8080:80 --name nginx nginx:alpine
See [`./docs/rootless.md`](./docs/rootless.md).

## Install
Binaries are available for amd64, arm64, and arm-v7: https://github.com/AkihiroSuda/nerdctl/releases
Binaries are available for amd64, arm64, and arm-v7: https://github.com/containerd/nerdctl/releases

In addition to containerd, the following components should be installed (optional):
- [CNI plugins](https://github.com/containernetworking/plugins): for using `nerdctl run`.
Expand Down Expand Up @@ -109,12 +111,19 @@ Trivial:
- [PouchContainer (abandoned?)](https://github.com/alibaba/pouch): needs an extra daemon

## Developer guide
nerdctl is a containerd **non-core** sub-project, licensed under the [Apache 2.0 license](./LICENSE).
As a containerd non-core sub-project, you will find the:
* [Project governance](https://github.com/containerd/project/blob/master/GOVERNANCE.md),
* [Maintainers](./MAINTAINERS),
* and [Contributing guidelines](https://github.com/containerd/project/blob/master/CONTRIBUTING.md)

information in our [`containerd/project`](https://github.com/containerd/project) repository.

### Compiling nerdctl from source

Run `make && sudo make install`.

Using `go get github.com/AkihiroSuda/nerdctl` is possible, but unrecommended because it does not fill version strings printed in `nerdctl version`
Using `go get github.com/containerd/nerdctl` is possible, but unrecommended because it does not fill version strings printed in `nerdctl version`

### Test suite
#### Running test suite against nerdctl
Expand Down
9 changes: 4 additions & 5 deletions build.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
/*
Copyright (C) nerdctl authors.
Copyright (C) containerd authors.
Copyright The containerd Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand All @@ -22,9 +21,9 @@ import (
"os/exec"
"strings"

"github.com/AkihiroSuda/nerdctl/pkg/buildkitutil"
"github.com/AkihiroSuda/nerdctl/pkg/defaults"
"github.com/AkihiroSuda/nerdctl/pkg/strutil"
"github.com/containerd/nerdctl/pkg/buildkitutil"
"github.com/containerd/nerdctl/pkg/defaults"
"github.com/containerd/nerdctl/pkg/strutil"
"github.com/pkg/errors"
"github.com/sirupsen/logrus"
"github.com/urfave/cli/v2"
Expand Down
5 changes: 2 additions & 3 deletions build_test.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
/*
Copyright (C) nerdctl authors.
Copyright (C) containerd authors.
Copyright The containerd Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand All @@ -24,7 +23,7 @@ import (
"path/filepath"
"testing"

"github.com/AkihiroSuda/nerdctl/pkg/testutil"
"github.com/containerd/nerdctl/pkg/testutil"
"gotest.tools/v3/assert"
)

Expand Down
3 changes: 1 addition & 2 deletions client.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
/*
Copyright (C) nerdctl authors.
Copyright (C) containerd authors.
Copyright The containerd Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
7 changes: 3 additions & 4 deletions commit.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
/*
Copyright (C) nerdctl authors.
Copyright (C) containerd authors.
Copyright The containerd Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand All @@ -21,9 +20,9 @@ import (
"context"
"fmt"

"github.com/AkihiroSuda/nerdctl/pkg/idutil/containerwalker"
"github.com/AkihiroSuda/nerdctl/pkg/imgutil/commit"
refdocker "github.com/containerd/containerd/reference/docker"
"github.com/containerd/nerdctl/pkg/idutil/containerwalker"
"github.com/containerd/nerdctl/pkg/imgutil/commit"
"github.com/pkg/errors"
"github.com/urfave/cli/v2"
)
Expand Down
7 changes: 3 additions & 4 deletions completion.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
/*
Copyright (C) nerdctl authors.
Copyright (C) containerd authors.
Copyright The containerd Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand All @@ -22,8 +21,8 @@ import (
"os"
"strings"

"github.com/AkihiroSuda/nerdctl/pkg/labels"
"github.com/AkihiroSuda/nerdctl/pkg/netutil"
"github.com/containerd/nerdctl/pkg/labels"
"github.com/containerd/nerdctl/pkg/netutil"
"github.com/urfave/cli/v2"
)

Expand Down
5 changes: 2 additions & 3 deletions completion_test.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
/*
Copyright (C) nerdctl authors.
Copyright (C) containerd authors.
Copyright The containerd Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand All @@ -20,7 +19,7 @@ package main
import (
"testing"

"github.com/AkihiroSuda/nerdctl/pkg/testutil"
"github.com/containerd/nerdctl/pkg/testutil"
)

func TestCompletion(t *testing.T) {
Expand Down
3 changes: 1 addition & 2 deletions container.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
/*
Copyright (C) nerdctl authors.
Copyright (C) containerd authors.
Copyright The containerd Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
9 changes: 4 additions & 5 deletions container_inspect.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
/*
Copyright (C) nerdctl authors.
Copyright (C) containerd authors.
Copyright The containerd Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand All @@ -23,9 +22,9 @@ import (
"fmt"
"time"

"github.com/AkihiroSuda/nerdctl/pkg/containerinspector"
"github.com/AkihiroSuda/nerdctl/pkg/idutil/containerwalker"
"github.com/AkihiroSuda/nerdctl/pkg/inspecttypes/dockercompat"
"github.com/containerd/nerdctl/pkg/containerinspector"
"github.com/containerd/nerdctl/pkg/idutil/containerwalker"
"github.com/containerd/nerdctl/pkg/inspecttypes/dockercompat"
"github.com/pkg/errors"
"github.com/urfave/cli/v2"
)
Expand Down
2 changes: 1 addition & 1 deletion docs/registry.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ $ nerdctl --insecure-registry run --rm 192.168.12.34:5000/foo
Currently, rootless nerdctl cannot pull images from 127.0.0.1, because
the pull operation occurs in RootlessKit's network namespace.

See https://github.com/AkihiroSuda/nerdctl/issues/86 for the discussion about workarounds.
See https://github.com/containerd/nerdctl/issues/86 for the discussion about workarounds.
3 changes: 1 addition & 2 deletions events.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
/*
Copyright (C) nerdctl authors.
Copyright (C) containerd authors.
Copyright The containerd Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
9 changes: 4 additions & 5 deletions exec.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
/*
Copyright (C) nerdctl authors.
Copyright (C) containerd authors.
Copyright The containerd Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand All @@ -22,15 +21,15 @@ import (
"io"
"os"

"github.com/AkihiroSuda/nerdctl/pkg/idutil/containerwalker"
"github.com/AkihiroSuda/nerdctl/pkg/strutil"
"github.com/AkihiroSuda/nerdctl/pkg/taskutil"
"github.com/containerd/console"
"github.com/containerd/containerd"
"github.com/containerd/containerd/cio"
"github.com/containerd/containerd/cmd/ctr/commands"
"github.com/containerd/containerd/cmd/ctr/commands/tasks"
"github.com/containerd/containerd/pkg/cap"
"github.com/containerd/nerdctl/pkg/idutil/containerwalker"
"github.com/containerd/nerdctl/pkg/strutil"
"github.com/containerd/nerdctl/pkg/taskutil"
"github.com/opencontainers/runtime-spec/specs-go"
"github.com/pkg/errors"
"github.com/sirupsen/logrus"
Expand Down
33 changes: 17 additions & 16 deletions extras/rootless/containerd-rootless-setuptool.sh
Original file line number Diff line number Diff line change
@@ -1,22 +1,23 @@
#!/bin/sh
# Copyright (C) containerd Authors.
# Copyright (C) nerdctl Authors.
# Copyright (C) Moby Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Forked from https://github.com/moby/moby/blob/v20.10.3/contrib/dockerd-rootless-setuptool.sh
# Copyright The containerd Authors.

# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at

# http://www.apache.org/licenses/LICENSE-2.0

# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# -----------------------------------------------------------------------------
# Forked from https://github.com/moby/moby/blob/v20.10.3/contrib/dockerd-rootless-setuptool.sh
# Copyright The Moby Authors.
# Licensed under the Apache License, Version 2.0
# -----------------------------------------------------------------------------

# containerd-rootless-setuptool.sh: setup tool for containerd-rootless.sh
Expand Down

0 comments on commit 435f533

Please sign in to comment.