Compare commits

...

1109 Commits

Author SHA1 Message Date
Akihiro Suda 507bfee191
Merge pull request #4408 from containerd/dependabot/go_modules/docker-0e145687d2
build(deps): bump the docker group with 2 updates
2025-07-14 17:26:39 +09:00
Akihiro Suda 38596c8b22
Merge pull request #4409 from containerd/dependabot/go_modules/golang-x-00b2bb0006
build(deps): bump the golang-x group across 1 directory with 6 updates
2025-07-12 23:07:05 +09:00
dependabot[bot] 6157151749
build(deps): bump the golang-x group across 1 directory with 6 updates
Bumps the golang-x group with 2 updates in the / directory: [golang.org/x/crypto](https://github.com/golang/crypto) and [golang.org/x/net](https://github.com/golang/net).


Updates `golang.org/x/crypto` from 0.39.0 to 0.40.0
- [Commits](https://github.com/golang/crypto/compare/v0.39.0...v0.40.0)

Updates `golang.org/x/net` from 0.41.0 to 0.42.0
- [Commits](https://github.com/golang/net/compare/v0.41.0...v0.42.0)

Updates `golang.org/x/sync` from 0.15.0 to 0.16.0
- [Commits](https://github.com/golang/sync/compare/v0.15.0...v0.16.0)

Updates `golang.org/x/sys` from 0.33.0 to 0.34.0
- [Commits](https://github.com/golang/sys/compare/v0.33.0...v0.34.0)

Updates `golang.org/x/term` from 0.32.0 to 0.33.0
- [Commits](https://github.com/golang/term/compare/v0.32.0...v0.33.0)

Updates `golang.org/x/text` from 0.26.0 to 0.27.0
- [Release notes](https://github.com/golang/text/releases)
- [Commits](https://github.com/golang/text/compare/v0.26.0...v0.27.0)

---
updated-dependencies:
- dependency-name: golang.org/x/crypto
  dependency-version: 0.40.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: golang-x
- dependency-name: golang.org/x/net
  dependency-version: 0.42.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: golang-x
- dependency-name: golang.org/x/sync
  dependency-version: 0.16.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: golang-x
- dependency-name: golang.org/x/sys
  dependency-version: 0.34.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: golang-x
- dependency-name: golang.org/x/term
  dependency-version: 0.33.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: golang-x
- dependency-name: golang.org/x/text
  dependency-version: 0.27.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: golang-x
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-07-10 22:04:45 +00:00
dependabot[bot] 248d28a764
build(deps): bump the docker group with 2 updates
Bumps the docker group with 2 updates: [github.com/docker/cli](https://github.com/docker/cli) and [github.com/docker/docker](https://github.com/docker/docker).


Updates `github.com/docker/cli` from 28.3.1+incompatible to 28.3.2+incompatible
- [Commits](https://github.com/docker/cli/compare/v28.3.1...v28.3.2)

Updates `github.com/docker/docker` from 28.3.1+incompatible to 28.3.2+incompatible
- [Release notes](https://github.com/docker/docker/releases)
- [Commits](https://github.com/docker/docker/compare/v28.3.1...v28.3.2)

---
updated-dependencies:
- dependency-name: github.com/docker/cli
  dependency-version: 28.3.2+incompatible
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: docker
- dependency-name: github.com/docker/docker
  dependency-version: 28.3.2+incompatible
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: docker
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-07-09 22:08:24 +00:00
Akihiro Suda ff9323859a
Merge pull request #4404 from AkihiroSuda/dev
update containerd (2.1.3), BuildKit (0.23.2), slirp4netns (1.3.3), etc.
2025-07-08 09:33:58 +09:00
Akihiro Suda 2da141b283
update Kubo (0.35.0)
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2025-07-07 17:22:00 +09:00
Akihiro Suda d3a009f139
update Nydus (2.3.2)
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2025-07-07 17:21:39 +09:00
Akihiro Suda fb86ede0a2
update gotestsum (1.12.3)
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2025-07-07 17:21:21 +09:00
Akihiro Suda 2894a94c12
update slirp4netns (1.3.3)
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2025-07-07 17:19:03 +09:00
Akihiro Suda 27b707f152
update BuildKit (0.23.2)
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2025-07-07 17:17:52 +09:00
Akihiro Suda f450c33b75
update containerd (2.1.3)
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2025-07-07 17:15:59 +09:00
Akihiro Suda e6429167ae
Merge pull request #4399 from ChengyuZhu6/refactor
Rename flag variables to descriptive boolean names
2025-07-07 16:31:41 +09:00
Akihiro Suda 6c1728eae2
Merge pull request #4401 from Mr-Sunglasses/fix/#4313
feat: Add completions for 'nerdctl network create -o'
2025-07-07 16:23:21 +09:00
Kanishk Pachauri d9d2f0b1b4
feat: Add completions for 'nerdctl network create -o'
Signed-off-by: Kanishk Pachauri <itskanishkp.py@gmail.com>

fix: remove unimplemented networks

Signed-off-by: Kanishk Pachauri <itskanishkp.py@gmail.com>

fix: remove unimplemented networks

Signed-off-by: Kanishk Pachauri <itskanishkp.py@gmail.com>
2025-07-06 11:50:07 +05:30
Akihiro Suda a3e753580e
Merge pull request #4402 from containerd/dependabot/go_modules/docker-adc901a5e6
build(deps): bump the docker group with 2 updates
2025-07-04 13:01:28 +09:00
dependabot[bot] a7b01be272
build(deps): bump the docker group with 2 updates
Bumps the docker group with 2 updates: [github.com/docker/cli](https://github.com/docker/cli) and [github.com/docker/docker](https://github.com/docker/docker).


Updates `github.com/docker/cli` from 28.3.0+incompatible to 28.3.1+incompatible
- [Commits](https://github.com/docker/cli/compare/v28.3.0...v28.3.1)

Updates `github.com/docker/docker` from 28.3.0+incompatible to 28.3.1+incompatible
- [Release notes](https://github.com/docker/docker/releases)
- [Commits](https://github.com/docker/docker/compare/v28.3.0...v28.3.1)

---
updated-dependencies:
- dependency-name: github.com/docker/cli
  dependency-version: 28.3.1+incompatible
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: docker
- dependency-name: github.com/docker/docker
  dependency-version: 28.3.1+incompatible
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: docker
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-07-03 22:36:39 +00:00
ChengyuZhu6 2eb82b6c61 rename flag variables to descriptive boolean names
Improves code readability by replacing short flag names (flagA, flagI, flagT, flagD)
with descriptive boolean names (isAttach, isInteractive, isTerminal, isDetach).

Signed-off-by: ChengyuZhu6 <hudson@cyzhu.com>
2025-07-03 21:41:50 +08:00
Akihiro Suda bc05100159
Merge pull request #4398 from ChengyuZhu6/save
cmd/image: update save command usage string
2025-07-03 11:53:23 +09:00
Akihiro Suda 14a59a2b76
Merge pull request #4378 from swagatbora90/add-global-dns-config
Enable setting DNS options through global nerdctl config
2025-07-03 11:49:43 +09:00
ChengyuZhu6 0b068a559d cmd/image: update save command usage string
Show proper syntax with flags and image arguments in help text.

Fixes: #4397

Signed-off-by: ChengyuZhu6 <hudson@cyzhu.com>
2025-07-03 10:17:32 +08:00
Akihiro Suda bae71e646d
Merge pull request #4300 from coderbirju/add-soci-convert
add soci to nerdctl image convert
2025-07-03 11:14:20 +09:00
Arjun Raja Yogidas 337f5a134e fix golangci-lint
Signed-off-by: Arjun Raja Yogidas <arjunry@amazon.com>
2025-07-02 20:49:30 +00:00
Swagat Bora 1ac8bb4708 Enable setting DNS options through global nerdctl config
Signed-off-by: Swagat Bora <sbora@amazon.com>
2025-07-02 16:48:02 +00:00
Arjun Raja Yogidas b4bcc305ed check soci version
Signed-off-by: Arjun Raja Yogidas <arjunry@amazon.com>
2025-07-02 16:40:57 +00:00
Arjun Raja Yogidas 445fb7b140 add soci convert feature
Signed-off-by: Arjun Raja Yogidas <arjunry@amazon.com>
2025-07-02 16:40:57 +00:00
Akihiro Suda 75640408c5
Merge pull request #4396 from Shubhranshu153/update-soci-version
update soci version to latest
2025-07-02 16:43:16 +09:00
Shubhranshu Mahapatra 824af52753 update soci base version to latest
Signed-off-by: Shubhranshu Mahapatra <shubhum@amazon.com>
2025-07-02 00:33:18 -07:00
Akihiro Suda 5c256f9ea1
Merge pull request #4388 from ChengyuZhu6/zstd
commit: Add support for converting writable layers to zstdchunked blobs
2025-07-02 16:07:51 +09:00
Akihiro Suda ece3f19a66
Merge pull request #4393 from Shubhranshu153/fix-soci-test
fix: allow soci v1 pulls for existing tests
2025-07-02 16:07:10 +09:00
Mahapatra 71a1d7bcaa fix: allow soci v1 pulls for existing tests
Signed-off-by: Shubhranshu Mahapatra <shubhum@amazon.com>
2025-07-01 20:44:19 -07:00
fahed dorgaa 02cfb57857
Merge pull request #4392 from swagatbora90/wait_for_process_io
exec: wait for I/O completion before return
2025-07-01 20:43:47 +02:00
Swagat Bora a59d0ac61a exec: wait for I/O completion before return
Signed-off-by: Swagat Bora <sbora@amazon.com>
2025-07-01 17:41:54 +00:00
ChengyuZhu6 2baeb05d7c commit: support zstdchunked conversion with writable layer in container commit
support zstdchunked conversion with writable layer in container commit

Signed-off-by: ChengyuZhu6 <hudson@cyzhu.com>
2025-07-01 14:54:25 +08:00
Akihiro Suda 0b89b6bb00
Merge pull request #4390 from containerd/dependabot/go_modules/go.yaml.in/yaml/v3-3.0.4
build(deps): bump go.yaml.in/yaml/v3 from 3.0.3 to 3.0.4
2025-07-01 14:46:03 +09:00
Akihiro Suda 07cc69cb30
Merge pull request #4389 from containerd/dependabot/go_modules/github.com/compose-spec/compose-go/v2-2.7.1
build(deps): bump github.com/compose-spec/compose-go/v2 from 2.6.5 to 2.7.1
2025-07-01 14:21:09 +09:00
dependabot[bot] 671b7fe99a
build(deps): bump go.yaml.in/yaml/v3 from 3.0.3 to 3.0.4
Bumps [go.yaml.in/yaml/v3](https://github.com/yaml/go-yaml) from 3.0.3 to 3.0.4.
- [Commits](https://github.com/yaml/go-yaml/compare/v3.0.3...v3.0.4)

---
updated-dependencies:
- dependency-name: go.yaml.in/yaml/v3
  dependency-version: 3.0.4
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-07-01 02:14:28 +00:00
dependabot[bot] 42b1c2eb9d
build(deps): bump github.com/compose-spec/compose-go/v2
Bumps [github.com/compose-spec/compose-go/v2](https://github.com/compose-spec/compose-go) from 2.6.5 to 2.7.1.
- [Release notes](https://github.com/compose-spec/compose-go/releases)
- [Commits](https://github.com/compose-spec/compose-go/compare/v2.6.5...v2.7.1)

---
updated-dependencies:
- dependency-name: github.com/compose-spec/compose-go/v2
  dependency-version: 2.7.1
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-07-01 01:19:12 +00:00
Akihiro Suda 8e777577fd
Merge pull request #4381 from AkihiroSuda/no_ipfs
Add build tag `no_ipfs`
2025-06-30 16:31:16 +09:00
Akihiro Suda b66e7fa843
Merge pull request #4386 from containerd/dependabot/go_modules/github.com/Masterminds/semver/v3-3.4.0
build(deps): bump github.com/Masterminds/semver/v3 from 3.3.1 to 3.4.0
2025-06-30 15:18:29 +09:00
Akihiro Suda c731c259a9
Add build tag `no_ipfs`
```
BUILDTAGS=no_ipfs make
```

Discussed in issue 1986

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2025-06-30 14:49:44 +09:00
dependabot[bot] 53ee7d84d2
build(deps): bump github.com/Masterminds/semver/v3 from 3.3.1 to 3.4.0
Bumps [github.com/Masterminds/semver/v3](https://github.com/Masterminds/semver) from 3.3.1 to 3.4.0.
- [Release notes](https://github.com/Masterminds/semver/releases)
- [Changelog](https://github.com/Masterminds/semver/blob/master/CHANGELOG.md)
- [Commits](https://github.com/Masterminds/semver/compare/v3.3.1...v3.4.0)

---
updated-dependencies:
- dependency-name: github.com/Masterminds/semver/v3
  dependency-version: 3.4.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-06-30 02:00:55 +00:00
Akihiro Suda b31cbf7a01
Merge pull request #4385 from haytok/followup_of_issue_4027
fix: allow storing additional network info in network-config.json
2025-06-30 10:58:45 +09:00
Akihiro Suda c555e0228c
Merge pull request #4383 from ningmingxiao/fix_health_check
bugfix:wait health check log complete
2025-06-30 10:58:21 +09:00
Hayato Kiwata 59890cbd87 fix: allow storing additional network info in network-config.json
When we specify the `-p` option with `nerdctl run`, etc., the port mapping
information is stored in the following `network-config.json`.

```
<DATAROOT>/<ADDRHASH>/containers/<NAMESPACE>/<CID>/network-config.json
```

However, the current implementation can only store port mapping
information and does not have the extensibility to store other
network-related information.

This point was feedback in the following PR.

- https://github.com/containerd/nerdctl/pull/4376

Therefore, this commit updates the `network-config.json` to allow for the
expansion of the information that can be stored.

Signed-off-by: Hayato Kiwata <haytok@amazon.co.jp>
2025-06-27 17:47:01 +00:00
ningmingxiao 7f8422b33f bugfix:wait health check log complete
Signed-off-by: ningmingxiao <ning.mingxiao@zte.com.cn>
2025-06-27 16:06:20 +08:00
Akihiro Suda 90e0caaf46
Merge pull request #4358 from apostasie/2025-06-fix-4343
[CI]: make healthcheck tests easier to debug
2025-06-26 15:35:30 +09:00
Akihiro Suda e832586924
Merge pull request #4372 from apostasie/2025-06-compose-exec-unlock
Allow compose exec concurrency
2025-06-26 15:33:55 +09:00
Akihiro Suda b25edf5694
Merge pull request #4354 from apostasie/2025-06-fixes
Hardening: internal/filesystem: prevent inode change on failure
2025-06-26 09:43:52 +09:00
Akihiro Suda 6fb2b45a0e
Merge pull request #4375 from containerd/dependabot/go_modules/docker-5b59b55a2a
build(deps): bump the docker group with 2 updates
2025-06-26 09:43:05 +09:00
dependabot[bot] 9f3eab454f
build(deps): bump the docker group with 2 updates
Bumps the docker group with 2 updates: [github.com/docker/cli](https://github.com/docker/cli) and [github.com/docker/docker](https://github.com/docker/docker).


Updates `github.com/docker/cli` from 28.2.2+incompatible to 28.3.0+incompatible
- [Commits](https://github.com/docker/cli/compare/v28.2.2...v28.3.0)

Updates `github.com/docker/docker` from 28.2.2+incompatible to 28.3.0+incompatible
- [Release notes](https://github.com/docker/docker/releases)
- [Commits](https://github.com/docker/docker/compare/v28.2.2...v28.3.0)

---
updated-dependencies:
- dependency-name: github.com/docker/cli
  dependency-version: 28.3.0+incompatible
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: docker
- dependency-name: github.com/docker/docker
  dependency-version: 28.3.0+incompatible
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: docker
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-06-25 22:13:21 +00:00
Akihiro Suda eb6b492937
Merge pull request #4290 from haytok/issue_4027
fix: allow containers to start using a large numbers of ports
2025-06-26 06:03:41 +09:00
apostasie b6ceafb667
Allow compose exec concurrency
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-06-25 13:36:08 -07:00
Akihiro Suda c1dcfa4ad3
Merge pull request #4359 from apostasie/2025-06-fix-4146
[CI]: rewrite compose test
2025-06-26 03:30:35 +09:00
apostasie 53e69a3800
Rewrite compose test (fix 4146)
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-06-25 10:31:53 -07:00
apostasie f7a92b1c3d
Improve debugging for healthcheck tests
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-06-25 09:53:01 -07:00
apostasie dc7971fb43
internal/filesystem minor fix
In case of error during write, the destination is being removed (before being possibly restored).
This may lead to certain (failure) scenarios where the inode would change, effectively breaking
container mounted files.

Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-06-25 08:33:54 -07:00
Akihiro Suda 599681f519
Merge pull request #4348 from apostasie/2025-05-ci-proofing-2
[CI] Fix broken image ref parsing and hard-coded data in tests
2025-06-25 23:04:36 +09:00
Akihiro Suda 15b2cc3a4e
Merge pull request #4355 from apostasie/2025-06-image-history
[CI] Cleanup TestImageHistory
2025-06-25 19:58:45 +09:00
Hayato Kiwata c13417d74a docs: add network-config.json description to dir.md
Signed-off-by: Hayato Kiwata <haytok@amazon.co.jp>
2025-06-25 09:34:46 +00:00
Hayato Kiwata 7d768be794 fix: allow containers to start using a large number of ports
Suppose we have a compose.yaml that allocates a large numbers of ports as
follows.

```
> cat compose.yaml
services:
  svc0:
    image: alpine
    command: "sleep infinity"
    ports:
      - '32000-32060:32000-32060'
```

When we run `nerdctl compose up -d` using this compose.yaml, we will get
the following error.

```
FATA[0000] create container failed validation: containers.Labels: label key and value length (4711 bytes) greater than maximum size (4096 bytes), key: nerdctl/ports: invalid argument
FATA[0000] error while creating container haytok-svc0-1: error while creating container haytok-svc0-1: exit status 1
```

This issue is reported in the following issue.

- https://github.com/containerd/nerdctl/issues/4027

This issue is considered to be the same as the one with errors when
trying to perform many port mappings, such as `nerdctl run -p 80:80 -p 81:81 ~ -p 1000:1000 ...`

The current implementation is processing to create a container with the
information specified in -p to the label.
And as can be seen from the error message, as the number of ports to be
port mapped increases, the creation of the container fails because it
violates the limit of the maximum number of bytes on the containerd side
that can be allocated for a label.

Therefore, this PR modifies the container creation process so that
containers can be launched without having to assign the information
specified in the -p option to the labels.

Specifically, port mapping information is stored in the following path,
and when port mapping information is required, it is retrieved from this
file.

```
<DATAROOT>/<ADDRHASH>/containers/<NAMESPACE>/<CID>/network-config.json
```

Signed-off-by: Hayato Kiwata <haytok@amazon.co.jp>
2025-06-25 09:33:58 +00:00
Akihiro Suda debc5f6241
Merge pull request #4368 from pendo324/use-envvar-for-buildkit
refactor: move BUILDKIT_HOST to buildkitutil
2025-06-25 14:23:44 +09:00
Akihiro Suda d43f1d537d
Merge pull request #4360 from apostasie/2025-06-4322
[CI] Add delay for windows network test
2025-06-25 14:22:58 +09:00
Akihiro Suda 781f98b75d
Merge pull request #4369 from apostasie/2025-06-hc
[CI]: fix healthcheck test delay
2025-06-25 13:19:55 +09:00
apostasie 96ae9256ba
Fix broken image parsing and hard-coded data in tests
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-06-24 20:10:56 -07:00
apostasie b3a87c3938
Add DoesNotMatch comparator
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-06-24 20:10:55 -07:00
Akihiro Suda a7f4976a9d
Merge pull request #4362 from apostasie/2025-06-remove-lock
Simplify healthcheck file handling + fix locking
2025-06-25 11:34:55 +09:00
Akihiro Suda 0a5cb1dd4f
Merge pull request #4352 from ChengyuZhu6/estargz
commit: Add support for converting writable layers to eStargz blobs
2025-06-25 10:33:09 +09:00
Akihiro Suda 1345f246a8
Merge pull request #4327 from apostasie/2025-05-more-tests-2
[CI] Update registry testing tooling
2025-06-25 10:24:59 +09:00
apostasie 792e7f9cae
Fix healthcheck test
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-06-24 10:25:02 -07:00
Justin Alvarez 5e5e96e743
refactor: move BUILDKIT_HOST to buildkitutil
Signed-off-by: Justin Alvarez <alvajus@amazon.com>
2025-06-24 16:44:38 +00:00
ChengyuZhu6 9fa9071745 commit: support estargz conversion with writable layer in container commit
support estargz conversion with writable layer in container commit

Fixes: #4351

Signed-off-by: ChengyuZhu6 <hudson@cyzhu.com>
2025-06-24 14:13:59 +08:00
Akihiro Suda d0d1c2d804
Merge pull request #4357 from apostasie/2025-06-fix-4106
[CI] Kube test: wait for image
2025-06-24 12:47:52 +09:00
Akihiro Suda fd4477a84a
Merge pull request #4356 from apostasie/2025-06-build-examples
[CI] Build examples
2025-06-24 12:04:42 +09:00
ChengyuZhu6 fe8d6afd79 image: extract image format options into separate structs
Reorganize `ImageConvertOptions` by extracting format-specific options
into dedicated structs (EstargzOptions, ZstdOptions, ZstdChunkedOptions,
NydusOptions, OverlaybdOptions) and embedding them for better code
organization and maintainability.

Signed-off-by: ChengyuZhu6 <hudson@cyzhu.com>
2025-06-24 09:56:37 +08:00
apostasie 1791615612
Kube test: wait for image
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-06-23 18:20:43 -07:00
apostasie 421872fee8
Simplify healthcheck file handling
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-06-23 18:00:34 -07:00
apostasie 228be771f1
Add delay for windows network test
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-06-23 18:00:05 -07:00
apostasie 554005ccc9
Build examples and enable on CI
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-06-23 17:58:09 -07:00
apostasie 08b026a1c0
Cleanup TestImageHistory
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-06-23 17:50:26 -07:00
apostasie 4fa13e2342
Fixes for TestImageConvertNydusVerify
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-06-23 17:45:46 -07:00
apostasie 599aa39d89
Update testutil HTTPGet refresh strategy
1. extend the refresh interval from 0.1 second to 1 second
2. normalize all calls to HTTPGet to repeat 5 times (instead of the mix of 10, 30, 5 etc)

We can in the future assess case by case if some tests need more time.
Note that the replacement does not reduce any existing test timeout (30 * 0.1 < 5)

Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-06-23 17:45:44 -07:00
apostasie 875ae4c9da
Move tests to new registry testing infrastructure
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-06-23 17:44:48 -07:00
apostasie 040bdead82
Fix broken tigron testca
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-06-23 17:44:47 -07:00
Akihiro Suda 62477fbe5b
Merge pull request #4341 from apostasie/2025-06-tigron-api-changes
[Tigron] API cleanup
2025-06-24 09:28:52 +09:00
Akihiro Suda 410b0f290b
Merge pull request #4330 from ChengyuZhu6/commit-format
commit: Add an option to nerdctl commit command for media type selection
2025-06-23 23:11:03 +09:00
fahed dorgaa 102476051b
Merge pull request #4349 from apostasie/2025-06-fix-healthcheck-tests
Ensure container started on healthcheck tests
2025-06-23 11:01:09 +02:00
ChengyuZhu6 df145ce245 commit: Add an option to nerdctl commit command for media type selection
Fixes: #4329

Signed-off-by: ChengyuZhu6 <hudson@cyzhu.com>
2025-06-23 14:56:31 +08:00
Akihiro Suda 9c56cda790
Merge pull request #4346 from apostasie/2025-06-canary-timeout
Bump CI timeout
2025-06-23 15:45:53 +09:00
Akihiro Suda 90ec23f0f3
Merge pull request #4350 from apostasie/2025-06-canary-token
Pass along GITHUB_TOKEN to canary
2025-06-23 15:45:16 +09:00
apostasie d232567a66
Pass along GITHUB_TOKEN
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-06-22 22:30:52 -07:00
apostasie df3df359a1
Ensure container started on healthcheck tests
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-06-22 22:15:03 -07:00
Akihiro Suda c24ee86b25
Merge pull request #4342 from apostasie/2025-06-yaml-dep
Move gopkg.in/yaml.v3 to maintained fork
2025-06-23 11:43:08 +09:00
Akihiro Suda 43543d97e7
Merge pull request #4345 from apostasie/2025-06-fix-tigron-lint
Re-enable tigron lint on the CI & makefile copy-pasta fix
2025-06-23 11:41:39 +09:00
Akihiro Suda 35eea81fb1
Merge pull request #4340 from apostasie/2025-06-as-a-lib-examples
Add example of using nerdctl as a library
2025-06-23 11:40:51 +09:00
apostasie 299b2968da
Move tigron funcs from *testing.T to tig.T
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-06-22 18:56:15 -07:00
apostasie 2f8c0c0914
Bump CI timeout
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-06-22 17:45:53 -07:00
apostasie 787bba68fb
Fix copy-paste error in Makefile
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-06-22 17:16:20 -07:00
apostasie ee8c5c1d97
Re-enable tigron lint on the CI
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-06-22 17:16:16 -07:00
apostasie 1784864c45
Remove deprecated info parameter in tigron funcs
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-06-22 15:40:26 -07:00
apostasie e08d320fef
xMove gopkg.in/yaml.v3 to maintained fork
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-06-22 14:31:39 -07:00
apostasie d53e06bf0c
Add example of using nerdctl as a library
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-06-22 13:50:34 -07:00
Akihiro Suda 4c0dd00232
Merge pull request #4194 from apostasie/2025-05-ci-proofing
Test images: cleanup and centralize
2025-06-23 05:47:34 +09:00
Akihiro Suda 3d44bd1197
Merge pull request #4240 from apostasie/2025-05-fs
internal/filesystem: finish moving os.WriteFile and os.ReadFile (and blacklist future use)
2025-06-23 05:46:16 +09:00
apostasie cfb5a16711
Add support for external embed test image list
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-06-21 15:41:04 -07:00
apostasie 5827adbe6c
Move leftover os.WriteFile and os.ReadFile to `filesystem`
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-06-21 15:32:30 -07:00
Akihiro Suda 87a6ab93ae
Merge pull request #4319 from tushar5526/use-stricter-regex-filter-match-network-labels
feat: use stricter regex to filter network labels on the container.
2025-06-21 22:51:30 +09:00
Akihiro Suda d828f4f351
Merge pull request #4335 from containerd/dependabot/go_modules/github.com/compose-spec/compose-go/v2-2.6.5
build(deps): bump github.com/compose-spec/compose-go/v2 from 2.6.4 to 2.6.5
2025-06-21 22:48:34 +09:00
Akihiro Suda 50adb44db9
Merge pull request #4336 from containerd/dependabot/go_modules/github.com/containerd/containerd/v2-2.1.3
build(deps): bump github.com/containerd/containerd/v2 from 2.1.2 to 2.1.3
2025-06-21 21:27:12 +09:00
Tushar Gupta b2f3b6cd0d feat: use stricter regex to filter network labels on the container.
This allows us to skip double checking the network names on the
container with an additional helper function.

Signed-off-by: Tushar Gupta <codingid6@gmail.com>
2025-06-21 16:28:07 +05:30
dependabot[bot] d516485683
build(deps): bump github.com/containerd/containerd/v2
Bumps [github.com/containerd/containerd/v2](https://github.com/containerd/containerd) from 2.1.2 to 2.1.3.
- [Release notes](https://github.com/containerd/containerd/releases)
- [Changelog](https://github.com/containerd/containerd/blob/main/RELEASES.md)
- [Commits](https://github.com/containerd/containerd/compare/v2.1.2...v2.1.3)

---
updated-dependencies:
- dependency-name: github.com/containerd/containerd/v2
  dependency-version: 2.1.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-06-20 22:47:15 +00:00
dependabot[bot] 4c39ab5a7a
build(deps): bump github.com/compose-spec/compose-go/v2
Bumps [github.com/compose-spec/compose-go/v2](https://github.com/compose-spec/compose-go) from 2.6.4 to 2.6.5.
- [Release notes](https://github.com/compose-spec/compose-go/releases)
- [Commits](https://github.com/compose-spec/compose-go/compare/v2.6.4...v2.6.5)

---
updated-dependencies:
- dependency-name: github.com/compose-spec/compose-go/v2
  dependency-version: 2.6.5
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-06-20 22:47:03 +00:00
Akihiro Suda 190a71390d
Merge pull request #4324 from apostasie/2025-06-fs-3
internal/filesystem consolidation, part 3 (no rename WriteFile, disaster recovery and rollbacks)
2025-06-21 07:18:47 +09:00
apostasie 84894d9aae
WriteFile with rollback and no inode change
WriteFile now:
- no longer relies on Rename, hence no longer changing files inodes
- have disaster recovery and rollback

Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-06-20 12:58:08 -07:00
Akihiro Suda 36f9236855
Merge pull request #4326 from jedevc/name-filter-regexp
feat: allow regexp name filters to match docker
2025-06-21 04:30:52 +09:00
Akihiro Suda c46f1f4c17
Merge pull request #4302 from subashkotha/health_checks
feat: Add healthcheck command in nerdctl
2025-06-21 03:22:26 +09:00
Justin Chadwell 27c25728fb lint: bump cognitive-complexity
Signed-off-by: Justin Chadwell <me@jedevc.com>
2025-06-20 11:44:10 +01:00
Akihiro Suda b60fbeaad1
Merge pull request #4312 from containerd/dependabot/github_actions/actions/attest-build-provenance-2.4.0
build(deps): bump actions/attest-build-provenance from 2.3.0 to 2.4.0
2025-06-20 12:50:41 +09:00
Subash Kotha c5805c5bed feat: Add healthcheck command in nerdctl
Signed-off-by: Subash Kotha <subash.kotha2@gmail.com>
2025-06-19 13:43:12 -07:00
dependabot[bot] c459113113
build(deps): bump actions/attest-build-provenance from 2.3.0 to 2.4.0
Bumps [actions/attest-build-provenance](https://github.com/actions/attest-build-provenance) from 2.3.0 to 2.4.0.
- [Release notes](https://github.com/actions/attest-build-provenance/releases)
- [Changelog](https://github.com/actions/attest-build-provenance/blob/main/RELEASE.md)
- [Commits](db473fddc0...e8998f9491)

---
updated-dependencies:
- dependency-name: actions/attest-build-provenance
  dependency-version: 2.4.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-06-19 18:15:41 +00:00
Justin Chadwell f073052058 feat: allow regexp name filters to match docker
Signed-off-by: Justin Chadwell <me@jedevc.com>
2025-06-19 16:16:35 +01:00
Akihiro Suda 4bde79d58a
Merge pull request #4314 from containerd/dependabot/go_modules/github.com/containerd/containerd/v2-2.1.2
build(deps): bump github.com/containerd/containerd/v2 from 2.1.1 to 2.1.2
2025-06-19 18:23:15 +09:00
Akihiro Suda 5be808b41c
Merge pull request #4325 from containerd/dependabot/github_actions/docker/setup-buildx-action-3.11.1
build(deps): bump docker/setup-buildx-action from 3.10.0 to 3.11.1
2025-06-19 18:22:19 +09:00
Akihiro Suda 30857ef14c
Merge pull request #4308 from apostasie/2025-06-fs
internal/filesystem consolidation, part 2
2025-06-19 17:32:24 +09:00
dependabot[bot] 98aa61891b
build(deps): bump github.com/containerd/containerd/v2
Bumps [github.com/containerd/containerd/v2](https://github.com/containerd/containerd) from 2.1.1 to 2.1.2.
- [Release notes](https://github.com/containerd/containerd/releases)
- [Changelog](https://github.com/containerd/containerd/blob/main/RELEASES.md)
- [Commits](https://github.com/containerd/containerd/compare/v2.1.1...v2.1.2)

---
updated-dependencies:
- dependency-name: github.com/containerd/containerd/v2
  dependency-version: 2.1.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-06-19 03:30:53 +00:00
Akihiro Suda 7ad308c342
Merge pull request #4320 from containerd/dependabot/go_modules/github.com/go-viper/mapstructure/v2-2.3.0
build(deps): bump github.com/go-viper/mapstructure/v2 from 2.2.1 to 2.3.0
2025-06-19 12:29:00 +09:00
dependabot[bot] e2db1e1e01
build(deps): bump docker/setup-buildx-action from 3.10.0 to 3.11.1
Bumps [docker/setup-buildx-action](https://github.com/docker/setup-buildx-action) from 3.10.0 to 3.11.1.
- [Release notes](https://github.com/docker/setup-buildx-action/releases)
- [Commits](b5ca514318...e468171a9d)

---
updated-dependencies:
- dependency-name: docker/setup-buildx-action
  dependency-version: 3.11.1
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-06-18 22:12:33 +00:00
apostasie f3dc0eee52
Forbidigo: prevent os fs operations
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-06-18 12:56:39 -07:00
apostasie 21e112424d
Move from os filesystem operations to internal/filesystem
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-06-18 12:56:29 -07:00
apostasie f38310bb9e
Fix typo in `across`.
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-06-18 10:03:17 -07:00
dependabot[bot] b074e5b04f
build(deps): bump github.com/go-viper/mapstructure/v2
Bumps [github.com/go-viper/mapstructure/v2](https://github.com/go-viper/mapstructure) from 2.2.1 to 2.3.0.
- [Release notes](https://github.com/go-viper/mapstructure/releases)
- [Changelog](https://github.com/go-viper/mapstructure/blob/main/CHANGELOG.md)
- [Commits](https://github.com/go-viper/mapstructure/compare/v2.2.1...v2.3.0)

---
updated-dependencies:
- dependency-name: github.com/go-viper/mapstructure/v2
  dependency-version: 2.3.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-06-18 06:20:50 +00:00
Akihiro Suda 81c6a301c2
Merge pull request #4318 from Shubhranshu153/update-go-license
fix: go-license dependency and fixes for provenance/sbom tests.
2025-06-18 15:19:16 +09:00
shubhranshu153 0eee948d0c fix: sbom and provenance tests
Signed-off-by: shubhranshu153 <shubhum@amazon.com>
2025-06-17 18:41:10 -07:00
shubhranshu153 9df1527422 fix:go-license dependency
Signed-off-by: shubhranshu153 <shubhum@amazon.com>
2025-06-17 18:40:47 -07:00
Akihiro Suda 401800a2f3
Merge pull request #4310 from haytok/refactor_network_inspect_test.go
test: refactor TestNetworkInspect in network_inspect_test.go
2025-06-11 11:48:00 +09:00
Hayato Kiwata fee517ad2f test: add one test case to TestNetworkInspect in network_inspect_test.go
Suppose that a `container A` is running in the network
`some-network-as-well`.

In this case, this commit adds a test to ensure that `container A` isn't
displayed in the `Containers` section of the output of
`nerdctl network inspect some-network`.

Signed-off-by: Hayato Kiwata <haytok@amazon.co.jp>
2025-06-09 15:44:47 +00:00
Hayato Kiwata 3086d71238 test: refactor TestNetworkInspect in network_inspect_test.go
Based on the following three pieces of advice received in the merged PR,
this commit refactors the tests.

- https://github.com/containerd/nerdctl/pull/4309#discussion_r2134362878
- https://github.com/containerd/nerdctl/pull/4309#discussion_r2134362909
- https://github.com/containerd/nerdctl/pull/4309#discussion_r2134363162

Signed-off-by: Hayato Kiwata <haytok@amazon.co.jp>
2025-06-09 15:23:29 +00:00
fahed dorgaa 221e3e0091
Merge pull request #4309 from haytok/fix_network_results_by_nerdctl_network_inspect
fix: display containers belonging to multiple networks in nerdctl network inspect
2025-06-07 20:39:29 +02:00
Hayato Kiwata a4957197c3 fix: display containers belonging to multiple networks in nerdctl network inspect
When a container belongs to multiple networks, running the nerdctl network
inspect command on the network to which the container belongs does not
display the container in the current implementation.

Specifically, it is displayed as follows.

```
$ sudo nerdctl run -d --name net --net=foo --net=bar nginx
d88e878f0c60823bd0c361bad250f27b19ad117fb3336fcf18fa26ab1910c367

$ sudo nerdctl network inspect foo | jq .[0].Containers
{}

$ sudo nerdctl network inspect bar | jq .[0].Containers
{}
```

Ideally, running the nerdctl network inspect command on the networks to
which the contaienr belongs should display the container name as follows.

```
$ sudo nerdctl network inspect foo | jq .[0].Containers
{
  "d88e878f0c60823bd0c361bad250f27b19ad117fb3336fcf18fa26ab1910c367": {
    "Name": "net"
  }
}

$ sudo nerdctl network inspect bar | jq .[0].Containers
{
  "d88e878f0c60823bd0c361bad250f27b19ad117fb3336fcf18fa26ab1910c367": {
    "Name": "net"
  }
}
```

Therefore, this behaviour is fixed in this PR.

Signed-off-by: Hayato Kiwata <haytok@amazon.co.jp>
2025-06-07 17:02:15 +00:00
Akihiro Suda d937248ac5
Merge pull request #4097 from swagatbora90/fix-port-check-vsiravar
[Bugfix] Check if port is used in publish flag [duplicate of #2190]
2025-06-07 01:38:33 +09:00
Akihiro Suda e5db88c1e6
Merge pull request #4307 from containerd/dependabot/go_modules/golang-x-40d93c76e9
build(deps): bump the golang-x group with 4 updates
2025-06-06 15:13:08 +09:00
Vishwas Siravara 04f836d7f9 Check if port is used in publish flag
Signed-off-by: Swagat Bora <sbora@amazon.com>

Co-authored-by: Vishwas Siravara <vsiravara@gmail.com>
2025-06-06 00:02:16 +00:00
dependabot[bot] 3fa39407f1
build(deps): bump the golang-x group with 4 updates
Bumps the golang-x group with 4 updates: [golang.org/x/crypto](https://github.com/golang/crypto), [golang.org/x/net](https://github.com/golang/net), [golang.org/x/sync](https://github.com/golang/sync) and [golang.org/x/text](https://github.com/golang/text).


Updates `golang.org/x/crypto` from 0.38.0 to 0.39.0
- [Commits](https://github.com/golang/crypto/compare/v0.38.0...v0.39.0)

Updates `golang.org/x/net` from 0.40.0 to 0.41.0
- [Commits](https://github.com/golang/net/compare/v0.40.0...v0.41.0)

Updates `golang.org/x/sync` from 0.14.0 to 0.15.0
- [Commits](https://github.com/golang/sync/compare/v0.14.0...v0.15.0)

Updates `golang.org/x/text` from 0.25.0 to 0.26.0
- [Release notes](https://github.com/golang/text/releases)
- [Commits](https://github.com/golang/text/compare/v0.25.0...v0.26.0)

---
updated-dependencies:
- dependency-name: golang.org/x/crypto
  dependency-version: 0.39.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: golang-x
- dependency-name: golang.org/x/net
  dependency-version: 0.41.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: golang-x
- dependency-name: golang.org/x/sync
  dependency-version: 0.15.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: golang-x
- dependency-name: golang.org/x/text
  dependency-version: 0.26.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: golang-x
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-06-05 22:05:24 +00:00
Akihiro Suda 32077c5065
Merge pull request #4255 from fahedouch/clean-up-iptables-in-oci-post-hook
fix: clean up iptables rules for stopped containers
2025-06-05 22:26:39 +09:00
fahed dorgaa 7eab2ceb20
Merge pull request #4303 from swagatbora90/fix-gomodjail-iptables
mark go-iptables with gomodjail unconfined directive
2025-06-04 19:02:06 +02:00
Swagat Bora a27427fd29 mark go-iptables as gomodjail unconfined
Signed-off-by: Swagat Bora <sbora@amazon.com>
2025-06-03 17:47:03 +00:00
fahed dorgaa e9ac446742
fix: improve network settings application and enhance iptables rule deletion
Signed-off-by: fahed dorgaa <fahed.dorgaa@gmail.com>
2025-06-03 15:19:57 +02:00
Akihiro Suda b8c4b3d852
Merge pull request #4301 from containerd/dependabot/go_modules/docker-3094adeb80
build(deps): bump the docker group with 2 updates
2025-05-31 11:49:12 +09:00
dependabot[bot] 5bfcf9f243
build(deps): bump the docker group with 2 updates
Bumps the docker group with 2 updates: [github.com/docker/cli](https://github.com/docker/cli) and [github.com/docker/docker](https://github.com/docker/docker).


Updates `github.com/docker/cli` from 28.1.1+incompatible to 28.2.0+incompatible
- [Commits](https://github.com/docker/cli/compare/v28.1.1...v28.2.0)

Updates `github.com/docker/docker` from 28.1.1+incompatible to 28.2.1+incompatible
- [Release notes](https://github.com/docker/docker/releases)
- [Commits](https://github.com/docker/docker/compare/v28.1.1...v28.2.1)

---
updated-dependencies:
- dependency-name: github.com/docker/cli
  dependency-version: 28.2.0+incompatible
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: docker
- dependency-name: github.com/docker/docker
  dependency-version: 28.2.1+incompatible
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: docker
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-05-30 22:42:39 +00:00
Akihiro Suda d247c5049b
Merge pull request #4295 from containerd/dependabot/go_modules/github.com/containerd/nydus-snapshotter-0.15.2
build(deps): bump github.com/containerd/nydus-snapshotter from 0.15.1 to 0.15.2
2025-05-30 15:47:49 +09:00
fahed dorgaa 7fc539bd71
Merge pull request #4284 from zzzzzzzzzy9/calculateCPU
<fix> stats: CPU perusage use the wrong systemUsage
2025-05-29 23:28:19 +02:00
fahed dorgaa 9bd346eb1b
Merge pull request #4298 from containerd/dependabot/github_actions/docker/build-push-action-6.18.0
build(deps): bump docker/build-push-action from 6.17.0 to 6.18.0
2025-05-28 18:24:11 +02:00
fahed dorgaa 5118b48fe3
Merge pull request #4299 from containerd/dependabot/github_actions/lima-vm/lima-actions-1.0.1
build(deps): bump lima-vm/lima-actions from 1.0.0 to 1.0.1
2025-05-28 10:42:30 +02:00
dependabot[bot] c71cfb65c3
build(deps): bump lima-vm/lima-actions from 1.0.0 to 1.0.1
Bumps [lima-vm/lima-actions](https://github.com/lima-vm/lima-actions) from 1.0.0 to 1.0.1.
- [Release notes](https://github.com/lima-vm/lima-actions/releases)
- [Commits](be564a1408...03b96d6195)

---
updated-dependencies:
- dependency-name: lima-vm/lima-actions
  dependency-version: 1.0.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-05-27 22:13:33 +00:00
dependabot[bot] 1c9e0d33c8
build(deps): bump docker/build-push-action from 6.17.0 to 6.18.0
Bumps [docker/build-push-action](https://github.com/docker/build-push-action) from 6.17.0 to 6.18.0.
- [Release notes](https://github.com/docker/build-push-action/releases)
- [Commits](1dc7386353...263435318d)

---
updated-dependencies:
- dependency-name: docker/build-push-action
  dependency-version: 6.18.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-05-27 22:13:31 +00:00
zzzzzzzzzy9 5fcbccc4c1 <fix> stats: CPU perusage use the wrong systemUsage
Signed-off-by: zzzzzzzzzy9 <zhang.yu58@zte.com.cn>
2025-05-27 11:23:34 +08:00
dependabot[bot] 1e28020823
build(deps): bump github.com/containerd/nydus-snapshotter
Bumps [github.com/containerd/nydus-snapshotter](https://github.com/containerd/nydus-snapshotter) from 0.15.1 to 0.15.2.
- [Release notes](https://github.com/containerd/nydus-snapshotter/releases)
- [Commits](https://github.com/containerd/nydus-snapshotter/compare/v0.15.1...v0.15.2)

---
updated-dependencies:
- dependency-name: github.com/containerd/nydus-snapshotter
  dependency-version: 0.15.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-05-26 22:22:34 +00:00
Akihiro Suda aee274f18f
Merge pull request #4273 from haytok/update_portutil_test_on_the_last
test: update test functions in portutil_test.go
2025-05-26 19:17:56 +09:00
Hayato Kiwata 02b16a30c6 test: update test functions in portutil_test.go
- update the logic of TestParseFlagP
- rename TestTestParseFlagPWithPlatformSpec to the appropriate function
  name

Signed-off-by: Hayato Kiwata <haytok@amazon.co.jp>
2025-05-25 13:47:35 +00:00
Akihiro Suda 8cafefbb56
Merge pull request #4289 from apostasie/2025-05-empty-names
Prevent --name="" for container
2025-05-24 18:03:53 +09:00
Akihiro Suda 76b786b5ae
Merge pull request #4265 from apostasie/2025-05-github-raw-429
[CI]: move away from raw github domain to API
2025-05-24 18:01:48 +09:00
Akihiro Suda 3ac14a9029
Merge pull request #4286 from containerd/dependabot/go_modules/github.com/compose-spec/compose-go/v2-2.6.4
build(deps): bump github.com/compose-spec/compose-go/v2 from 2.6.3 to 2.6.4
2025-05-24 18:00:57 +09:00
apostasie dcbf14bc4e
Prevent empty container names
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-05-23 23:16:41 -07:00
dependabot[bot] 87a4206dcc
build(deps): bump github.com/compose-spec/compose-go/v2
Bumps [github.com/compose-spec/compose-go/v2](https://github.com/compose-spec/compose-go) from 2.6.3 to 2.6.4.
- [Release notes](https://github.com/compose-spec/compose-go/releases)
- [Commits](https://github.com/compose-spec/compose-go/compare/v2.6.3...v2.6.4)

---
updated-dependencies:
- dependency-name: github.com/compose-spec/compose-go/v2
  dependency-version: 2.6.4
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-05-23 23:00:45 +00:00
fahed dorgaa 694c405909
Merge pull request #4061 from lengrongfu/master
[Feat] Add commit compression type support
2025-05-22 10:40:37 +02:00
Akihiro Suda 4d415b4ad3
Merge pull request #4278 from yankay/cleanup-for-QF1012
[cleanup]: golang linter QF1012 to enforce fmt.Fprintf usage
2025-05-22 13:32:32 +09:00
rongfu.leng 41e1a56453 add commit compression type support
Signed-off-by: rongfu.leng <rongfu.leng@daocloud.io>
2025-05-22 11:30:24 +08:00
Kay Yan b0307c0898
cleanup for golang linter QF1012
Signed-off-by: Kay Yan <kay.yan@daocloud.io>
2025-05-21 11:59:41 +00:00
Akihiro Suda 1d88823a28
Merge pull request #4266 from apostasie/2025-05-more-tests
[CI] more tests cleanup
2025-05-21 18:15:49 +09:00
apostasie 01c83c7302
Use data.Temp() for assets
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-05-20 15:29:50 -07:00
apostasie 15914f1acb
Remove useless port bindings
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-05-20 15:29:49 -07:00
apostasie 40bdc2bcd1
Move from Alpine to Common for compose tests
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-05-20 15:29:48 -07:00
apostasie b5fa00b0f2
Remove version: from test compose yaml files
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-05-20 15:29:47 -07:00
apostasie 3b891956bc
Move away from raw github domain to API
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-05-20 15:29:33 -07:00
Akihiro Suda 2a2834dd1c
Merge pull request #4275 from AkihiroSuda/dev
update containerd (2.1.1), containerd-fuse-overlayfs (2.1.6), buildg (0.5.3)
2025-05-21 03:56:36 +09:00
Akihiro Suda c9f1cf6b14
Merge pull request #4274 from containerd/dependabot/go_modules/github.com/containerd/containerd/v2-2.1.1
build(deps): bump github.com/containerd/containerd/v2 from 2.1.0 to 2.1.1
2025-05-21 03:40:48 +09:00
Akihiro Suda 15cd2e0b97
update buildg (0.5.3)
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2025-05-21 03:17:04 +09:00
Akihiro Suda 24eaa88bef
update containerd-fuse-overlayfs (2.1.6)
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2025-05-21 03:12:14 +09:00
Akihiro Suda 4d68bfc5fe
update containerd (2.1.1)
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2025-05-21 03:11:29 +09:00
dependabot[bot] f396316397
build(deps): bump github.com/containerd/containerd/v2
Bumps [github.com/containerd/containerd/v2](https://github.com/containerd/containerd) from 2.1.0 to 2.1.1.
- [Release notes](https://github.com/containerd/containerd/releases)
- [Changelog](https://github.com/containerd/containerd/blob/main/RELEASES.md)
- [Commits](https://github.com/containerd/containerd/compare/v2.1.0...v2.1.1)

---
updated-dependencies:
- dependency-name: github.com/containerd/containerd/v2
  dependency-version: 2.1.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-05-20 18:03:56 +00:00
Akihiro Suda 1226b898b2
Merge pull request #4271 from ningmingxiao/write_cgroup
[feature] enable --security-opt writable-cgroups=true|false as an option
2025-05-21 02:56:15 +09:00
Akihiro Suda 68c4acfd42
Merge pull request #4203 from apostasie/2025-05-compose-tests-1
[CI]: rewrite some compose tests
2025-05-21 02:55:49 +09:00
Akihiro Suda 6466b731fd
Merge pull request #4270 from containerd/dependabot/go_modules/github.com/fluent/fluent-logger-golang-1.10.0
build(deps): bump github.com/fluent/fluent-logger-golang from 1.9.0 to 1.10.0
2025-05-21 01:26:15 +09:00
Akihiro Suda 7c6f380496
Merge pull request #4269 from containerd/dependabot/go_modules/github.com/containerd/console-1.0.5
build(deps): bump github.com/containerd/console from 1.0.4 to 1.0.5
2025-05-21 01:22:27 +09:00
ningmingxiao 166ea55fd8 [feature] enable --security-opt writable-cgroups=true|false as an option
Signed-off-by: ningmingxiao <ning.mingxiao@zte.com.cn>
2025-05-20 21:54:53 +08:00
dependabot[bot] 11054f7019
build(deps): bump github.com/fluent/fluent-logger-golang
Bumps [github.com/fluent/fluent-logger-golang](https://github.com/fluent/fluent-logger-golang) from 1.9.0 to 1.10.0.
- [Changelog](https://github.com/fluent/fluent-logger-golang/blob/master/CHANGELOG.md)
- [Commits](https://github.com/fluent/fluent-logger-golang/compare/v1.9.0...v1.10.0)

---
updated-dependencies:
- dependency-name: github.com/fluent/fluent-logger-golang
  dependency-version: 1.10.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-05-20 09:41:09 +00:00
dependabot[bot] 901769d8ef
build(deps): bump github.com/containerd/console from 1.0.4 to 1.0.5
Bumps [github.com/containerd/console](https://github.com/containerd/console) from 1.0.4 to 1.0.5.
- [Release notes](https://github.com/containerd/console/releases)
- [Commits](https://github.com/containerd/console/compare/v1.0.4...v1.0.5)

---
updated-dependencies:
- dependency-name: github.com/containerd/console
  dependency-version: 1.0.5
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-05-20 09:41:06 +00:00
Akihiro Suda 82cdd4056a
Merge pull request #4209 from apostasie/2025-05-fix-logs-test
[CI]: rewrite logs tests
2025-05-20 17:44:22 +09:00
Akihiro Suda f207d83e9e
Merge pull request #4263 from haytok/refactor_portutil_test.go
test: refactor TestTestParseFlagPWithPlatformSpec and TestParsePortsL…
2025-05-20 15:01:27 +09:00
Akihiro Suda 721a193e05
Merge pull request #4256 from apostasie/2025-05-fs-2
[REFACTOR] Filesystem, part 2: revamp locks
2025-05-20 15:00:54 +09:00
fahed dorgaa 3c8411b339
Merge pull request #4267 from containerd/dependabot/go_modules/github.com/compose-spec/compose-go/v2-2.6.3
build(deps): bump github.com/compose-spec/compose-go/v2 from 2.6.2 to 2.6.3
2025-05-20 02:05:35 +02:00
dependabot[bot] 42367649a4
build(deps): bump github.com/compose-spec/compose-go/v2
Bumps [github.com/compose-spec/compose-go/v2](https://github.com/compose-spec/compose-go) from 2.6.2 to 2.6.3.
- [Release notes](https://github.com/compose-spec/compose-go/releases)
- [Commits](https://github.com/compose-spec/compose-go/compare/v2.6.2...v2.6.3)

---
updated-dependencies:
- dependency-name: github.com/compose-spec/compose-go/v2
  dependency-version: 2.6.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-05-19 22:25:23 +00:00
Hayato Kiwata 0365d39441 test: refactor TestTestParseFlagPWithPlatformSpec and TestParsePortsLabel
Signed-off-by: Hayato Kiwata <haytok@amazon.co.jp>
2025-05-18 09:27:17 +00:00
apostasie 8bd7a7dc99
Rewrite logs tests and fix flakyness
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-05-17 12:13:16 -07:00
apostasie a91b1bb35b
Reduce RunSigProxyContainer refresh frequency
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-05-17 12:13:15 -07:00
apostasie 2c26839d13
Rewrite some compose tests
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-05-17 12:10:50 -07:00
apostasie 721e285b0d
Revamp lock
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-05-17 11:44:48 -07:00
Akihiro Suda 848062ece5
Merge pull request #4261 from haytok/update_portutil_test_v2
test: update test logic in TestTestParseFlagPWithPlatformSpec
2025-05-18 01:30:27 +09:00
Hayato Kiwata 1c74a704e3 test: update test logic in TestTestParseFlagPWithPlatformSpec
This test does not run in the rootfull Linux environment.
Also, there are some cases where the test does not run.
Therefore, this commit modifies all tests to perform the evaluation.

Note that when the host ports are not specified in the -p option of
`nerdctl run`, ports are randomly assigned, but it is not known what port
number will be assigned in each test.
Therefore, this commit modifies not to compare host ports.

Signed-off-by: Hayato Kiwata <haytok@amazon.co.jp>
2025-05-17 14:25:14 +00:00
Akihiro Suda 93c72b5bfb
Merge pull request #4258 from apostasie/2025-05-make-compose-people-happy
Add support for compose AdditionalContexts
2025-05-17 21:01:03 +09:00
Akihiro Suda 1cf746580d
Merge pull request #4257 from apostasie/2025-05-runtime-opt
Relax --runtime restrictions
2025-05-17 19:01:45 +09:00
Akihiro Suda e0367ae325
Merge pull request #4228 from AkihiroSuda/reviewer-Shubhranshu153
MAINTAINERS: add Shubharanshu Mahapatra (Shubhranshu153) as a REVIEWER
2025-05-17 18:39:37 +09:00
Akihiro Suda 66a553a1b6
Merge pull request #4259 from apostasie/2025-05-one-build-base
Use only one build base in Dockerfile
2025-05-17 18:33:46 +09:00
Akihiro Suda b7a46d6d20
Merge pull request #4260 from haytok/update_portutil_test
test: update test logic in TestParsePortsLabel
2025-05-17 18:31:21 +09:00
Hayato Kiwata cbd4ef2360 test: update test logic in TestParsePortsLabel
The current implementation does not compare []cni.PortMapping{} obtained
from labelMap and ParsePortsLabel() and want.
Therefore, this commit will update so that the evaluation is performed.

Signed-off-by: Hayato Kiwata <haytok@amazon.co.jp>
2025-05-17 07:27:47 +00:00
apostasie d166c3b0d8
Use only one build base in Dockerfile
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-05-16 22:03:22 -07:00
apostasie c0e32debae
Add support for compose AdditionalContexts
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-05-16 20:56:16 -07:00
apostasie cd1a24243e
Relax --runtime restrictions
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-05-16 19:40:03 -07:00
Akihiro Suda 772bb09ba5
Merge pull request #4247 from apostasie/2025-05-net-test-cleanup
[CI]: tests cleanup
2025-05-16 15:27:59 +09:00
Akihiro Suda 3914f637a8
Merge pull request #4245 from apostasie/2025-05-fs-b1
[REFACTOR]: consolidate filesystem ops into internal pkg
2025-05-16 10:24:56 +09:00
Akihiro Suda 3c333bb0da
Merge pull request #4248 from apostasie/2025-05-enable-tests
[CI]: re-enable tests following fixes
2025-05-16 08:42:51 +09:00
Akihiro Suda 9807c4d151
Merge pull request #4252 from containerd/dependabot/github_actions/docker/build-push-action-6.17.0
build(deps): bump docker/build-push-action from 6.16.0 to 6.17.0
2025-05-16 08:42:03 +09:00
Akihiro Suda 25f320f39a
Merge pull request #4250 from apostasie/2025-05-fix-non-unique-id
[CI]: fix use of non unique identifier
2025-05-16 08:41:42 +09:00
dependabot[bot] d28b664b37
build(deps): bump docker/build-push-action from 6.16.0 to 6.17.0
Bumps [docker/build-push-action](https://github.com/docker/build-push-action) from 6.16.0 to 6.17.0.
- [Release notes](https://github.com/docker/build-push-action/releases)
- [Commits](14487ce63c...1dc7386353)

---
updated-dependencies:
- dependency-name: docker/build-push-action
  dependency-version: 6.17.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-05-15 22:04:43 +00:00
apostasie d4cfdd94c5
Fix use on non unique identifier
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-05-15 13:52:55 -07:00
apostasie 3388ef6a22
Re-enable tests following fixes
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-05-15 12:02:33 -07:00
apostasie d9cf528510
Cleanup containers tests
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-05-15 11:15:37 -07:00
apostasie ff0e8ec807
Cleanup leftover on build test
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-05-15 10:15:49 -07:00
apostasie 368d2e27c2
Consolidate filesystem ops into pkg
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-05-14 10:07:00 -07:00
Akihiro Suda 0c2e76bb7c
Merge pull request #4176 from subashkotha/add_attach_options
feat: add --no-stdin flag to container attach
2025-05-13 14:36:27 +09:00
Subash Kotha 8586da2ae3 feat: add --no-stdin flag to container attach
Signed-off-by: Subash Kotha <subash.kotha2@gmail.com>
2025-05-12 10:18:02 -07:00
Akihiro Suda d16f34059f
Merge pull request #4242 from AkihiroSuda/fix-4241
Dockerfile: fix cross-compiling gomodjail
2025-05-12 20:14:44 +09:00
Akihiro Suda 58a5fe0588
Dockerfile: fix cross-compiling gomodjail
Fix issue 4241

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2025-05-12 18:53:46 +09:00
Akihiro Suda 8cc057fb07
CI: test `make artifacts` on every PR
A preparation toward fixing issue 4241

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2025-05-12 18:53:46 +09:00
Akihiro Suda 0b7f069819
Merge pull request #4238 from apostasie/2025-05-loong
Add loong64 as target for job-build + completion
2025-05-12 06:56:05 +09:00
apostasie dcd19765b4
Add loong64 as a build target + completion
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-05-10 12:39:23 -07:00
Akihiro Suda f860057a12
Merge pull request #4226 from fahedouch/fix-logs-follow-newline
fix: remove trailing newline from log entries on last decode iteration
2025-05-11 01:30:46 +09:00
Akihiro Suda 575f9e6445
Merge pull request #2533 from zhaixiaojuan/loong64-main
Add loong64 support
2025-05-10 22:21:45 +09:00
Akihiro Suda a5547bc8e4
Merge pull request #4202 from apostasie/2025-05-cni-concurrency-issue
[FIX] CNIEnv concurrency issue
2025-05-10 22:19:08 +09:00
Akihiro Suda 16e16f9b9b
Merge pull request #4234 from apostasie/2025-05-tigron-wait-fix
[DOC]: clarify corner case on Tigron WithFeeder
2025-05-10 22:18:08 +09:00
Akihiro Suda 074f396cc4
Merge pull request #4232 from apostasie/2025-05-fix-flaky-diff
[CI]: fix flaky diff test
2025-05-10 22:17:28 +09:00
Akihiro Suda 612b836331
Merge pull request #4229 from apostasie/2025-05-pin-docker
[CI]: pin docker to a specific version
2025-05-10 22:17:03 +09:00
Akihiro Suda 38c1020080
Merge pull request #4236 from containerd/dependabot/go_modules/github.com/vishvananda/netlink-1.3.1
build(deps): bump github.com/vishvananda/netlink from 1.3.1-0.20250303224720-0e7078ed04c8 to 1.3.1
2025-05-10 22:16:41 +09:00
fahed dorgaa a5d170183c
test: remove unnecessary sleep in container setup for log tests
Signed-off-by: fahed dorgaa <fahed.dorgaa@gmail.com>
2025-05-10 14:44:27 +02:00
zhaixiaojuan 1ec8f840e5 Add loong64 artifact
Signed-off-by: zhaixiaojuan <zhaixiaojuan@loongson.cn>
2025-05-10 14:44:55 +08:00
Akihiro Suda dfcdd51838
Merge pull request #4230 from apostasie/2025-05-vagrant-gpg
[CI]: carry a copy of vagrant gpg key
2025-05-10 13:44:58 +09:00
fahed dorgaa 87a976dc63
test: add delay to ensure logs are available before following
Signed-off-by: fahed dorgaa <fahed.dorgaa@gmail.com>
2025-05-10 01:57:17 +02:00
fahed dorgaa 3c376a817e
fix: avoid adding extraneous line feed when tail logs
Signed-off-by: fahed dorgaa <fahed.dorgaa@gmail.com>
2025-05-10 01:27:33 +02:00
dependabot[bot] ad8be25f8d
build(deps): bump github.com/vishvananda/netlink
Bumps [github.com/vishvananda/netlink](https://github.com/vishvananda/netlink) from 1.3.1-0.20250303224720-0e7078ed04c8 to 1.3.1.
- [Release notes](https://github.com/vishvananda/netlink/releases)
- [Commits](https://github.com/vishvananda/netlink/commits/v1.3.1)

---
updated-dependencies:
- dependency-name: github.com/vishvananda/netlink
  dependency-version: 1.3.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-05-09 22:37:33 +00:00
apostasie 38f07ca97f
(re)-tackle CNI concurrency issues
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-05-09 14:40:30 -07:00
apostasie 7680b12378
Clarify corner case on Tigron WithFeeder
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-05-09 13:09:23 -07:00
fahed dorgaa 01429e9cdb
Merge pull request #4227 from AkihiroSuda/dev
update RootlessKit (2.3.5), fuse-overlayfs (1.15), containerd-fuse-overlayfs (2.1.5), etc.
2025-05-09 22:00:57 +02:00
apostasie 9b1cd0822b
Fix flaky diff test
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-05-09 12:05:07 -07:00
apostasie a6585dd122
Carry a copy of vagrant gpg key
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-05-09 11:03:08 -07:00
apostasie bf7dac3c63
CI: pin docker to a specific version
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-05-09 11:02:14 -07:00
Akihiro Suda 9cb28b4a31
MAINTAINERS: add Shubharanshu Mahapatra (Shubhranshu153) as a REVIEWER
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2025-05-10 00:26:00 +09:00
Akihiro Suda a80f95f8fc
update gotestsum (1.12.2)
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2025-05-09 23:56:11 +09:00
Akihiro Suda 4c8b367c55
update containerd-fuse-overlayfs (2.1.5)
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2025-05-09 23:55:26 +09:00
Akihiro Suda fe5f1d1071
update fuse-overlayfs (1.15)
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2025-05-09 23:54:53 +09:00
Akihiro Suda db8eb683d7
update RootlessKit (2.3.5)
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2025-05-09 23:53:24 +09:00
Akihiro Suda f4bf3913f2
release note: add containerd v2.1 as a compatible version
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2025-05-09 23:49:15 +09:00
Akihiro Suda e94e9c6abe
Merge pull request #4212 from containerd/dependabot/go_modules/github.com/Microsoft/hcsshim-0.13.0
build(deps): bump github.com/Microsoft/hcsshim from 0.13.0-rc.3 to 0.13.0
2025-05-09 23:42:27 +09:00
dependabot[bot] 22bfe4d1b9
build(deps): bump github.com/Microsoft/hcsshim
Bumps [github.com/Microsoft/hcsshim](https://github.com/Microsoft/hcsshim) from 0.13.0-rc.3 to 0.13.0.
- [Release notes](https://github.com/Microsoft/hcsshim/releases)
- [Commits](https://github.com/Microsoft/hcsshim/compare/v0.13.0-rc.3...v0.13.0)

---
updated-dependencies:
- dependency-name: github.com/Microsoft/hcsshim
  dependency-version: 0.13.0
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-05-09 13:41:30 +00:00
Akihiro Suda 3d1ad82ac7
Merge pull request #4213 from containerd/dependabot/go_modules/github.com/compose-spec/compose-go/v2-2.6.2
build(deps): bump github.com/compose-spec/compose-go/v2 from 2.6.1 to 2.6.2
2025-05-09 22:40:20 +09:00
Akihiro Suda e556a92dd6
Merge pull request #4217 from Shubhranshu153/upgrage-containerd-2.1
update containerd version to 2.1.0
2025-05-09 16:48:52 +09:00
Shubharanshu Mahapatra 8b85431ea2 update containerd version to 2.1.0
Signed-off-by: Shubharanshu Mahapatra <shubhum@amazon.com>
2025-05-08 19:38:25 -07:00
dependabot[bot] aaaa3494b2
build(deps): bump github.com/compose-spec/compose-go/v2
Bumps [github.com/compose-spec/compose-go/v2](https://github.com/compose-spec/compose-go) from 2.6.1 to 2.6.2.
- [Release notes](https://github.com/compose-spec/compose-go/releases)
- [Commits](https://github.com/compose-spec/compose-go/compare/v2.6.1...v2.6.2)

---
updated-dependencies:
- dependency-name: github.com/compose-spec/compose-go/v2
  dependency-version: 2.6.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-05-09 00:51:10 +00:00
Akihiro Suda 43000329e8
Merge pull request #4211 from containerd/dependabot/go_modules/github.com/containerd/containerd/v2-2.1.0
build(deps): bump github.com/containerd/containerd/v2 from 2.1.0-rc.1 to 2.1.0
2025-05-09 08:53:49 +09:00
Akihiro Suda 3c14ab437a
Merge pull request #4225 from containerd/dependabot/github_actions/actions/setup-go-5.5.0
build(deps): bump actions/setup-go from 5.4.0 to 5.5.0
2025-05-09 08:53:06 +09:00
Akihiro Suda 00490ccb93
Merge pull request #4224 from containerd/dependabot/go_modules/github.com/rootless-containers/rootlesskit/v2-2.3.5
build(deps): bump github.com/rootless-containers/rootlesskit/v2 from 2.3.4 to 2.3.5
2025-05-09 08:52:35 +09:00
dependabot[bot] d117accdae
build(deps): bump actions/setup-go from 5.4.0 to 5.5.0
Bumps [actions/setup-go](https://github.com/actions/setup-go) from 5.4.0 to 5.5.0.
- [Release notes](https://github.com/actions/setup-go/releases)
- [Commits](0aaccfd150...d35c59abb0)

---
updated-dependencies:
- dependency-name: actions/setup-go
  dependency-version: 5.5.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-05-08 22:42:39 +00:00
dependabot[bot] cc32660e21
build(deps): bump github.com/rootless-containers/rootlesskit/v2
Bumps [github.com/rootless-containers/rootlesskit/v2](https://github.com/rootless-containers/rootlesskit) from 2.3.4 to 2.3.5.
- [Release notes](https://github.com/rootless-containers/rootlesskit/releases)
- [Commits](https://github.com/rootless-containers/rootlesskit/compare/v2.3.4...v2.3.5)

---
updated-dependencies:
- dependency-name: github.com/rootless-containers/rootlesskit/v2
  dependency-version: 2.3.5
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-05-08 22:24:17 +00:00
dependabot[bot] f72aee44b2
build(deps): bump github.com/containerd/containerd/v2
Bumps [github.com/containerd/containerd/v2](https://github.com/containerd/containerd) from 2.1.0-rc.1 to 2.1.0.
- [Release notes](https://github.com/containerd/containerd/releases)
- [Changelog](https://github.com/containerd/containerd/blob/main/RELEASES.md)
- [Commits](https://github.com/containerd/containerd/compare/v2.1.0-rc.1...v2.1.0)

---
updated-dependencies:
- dependency-name: github.com/containerd/containerd/v2
  dependency-version: 2.1.0
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-05-08 22:23:08 +00:00
Akihiro Suda 57b251f8cc
Merge pull request #4221 from apostasie/2025-05-fix-tigron-display
[Tigron]: fix debug display issue with pty
2025-05-09 07:22:49 +09:00
Akihiro Suda 51b5cf680f
Merge pull request #4222 from apostasie/2025-05-disable-docker-test
[CI BUST FIX]: fix docker target (disable docker testing for SigProxyFalse)
2025-05-09 07:02:20 +09:00
apostasie 69a21f36ec
Disable docker testing for SigProxyFalse
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-05-08 14:14:48 -07:00
apostasie e31a27ff44
Fix debug display issue with pty
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-05-08 13:18:29 -07:00
Kohei Tokunaga 10555b244e
Merge pull request #4216 from AkihiroSuda/fix-4214-1
TestRunWithLogBinary: workaround for "package slices is not in GOROOT"
2025-05-08 21:07:17 +09:00
Akihiro Suda 9a0695821d
TestRunWithLogBinary: workaround for "package slices is not in GOROOT"
Fix issue 4214 as a quick workaround

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2025-05-08 16:31:32 +09:00
fahed dorgaa 57e2f6e9f2
Merge pull request #4208 from AkihiroSuda/fix-1536
oci-hook: add /usr/sbin:/sbin to PATH for iptables
2025-05-07 22:19:52 +02:00
Akihiro Suda 4a395634f5
oci-hook: add /usr/sbin:/sbin to PATH for iptables
The directory of `iptables` is often missing in the default `$PATH`.

Fix issue 1536

Thanks to jeffrson for testing.

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2025-05-07 17:57:31 +09:00
Akihiro Suda 87fdc027fa
Merge pull request #4206 from containerd/dependabot/go_modules/github.com/containerd/containerd/v2-2.1.0-rc.1
build(deps): bump github.com/containerd/containerd/v2 from 2.1.0-rc.0 to 2.1.0-rc.1
2025-05-07 14:03:42 +09:00
Akihiro Suda 24f2bd7885
Merge pull request #3941 from Shubhranshu153/feat-nerdctl-userns
feat: add support for userns
2025-05-07 13:43:13 +09:00
Akihiro Suda 05278e2f75
Merge pull request #4207 from AkihiroSuda/gomodjail
update gomodjail (0.1.2)
2025-05-07 13:42:00 +09:00
Akihiro Suda d8b17e7df6
Revert "Workaround gomodjail concurrency issue"
This reverts commit 4039cfef3a.

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2025-05-07 12:55:04 +09:00
Akihiro Suda 0c50e70252
update gomodjail (0.1.2)
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2025-05-07 12:54:30 +09:00
Shubharanshu Mahapatra 38d67f09b4 feat: add support for userns
Signed-off-by: Shubharanshu Mahapatra <shubhum@amazon.com>
2025-05-06 20:40:38 -07:00
dependabot[bot] 7ac3125f5e
build(deps): bump github.com/containerd/containerd/v2
Bumps [github.com/containerd/containerd/v2](https://github.com/containerd/containerd) from 2.1.0-rc.0 to 2.1.0-rc.1.
- [Release notes](https://github.com/containerd/containerd/releases)
- [Changelog](https://github.com/containerd/containerd/blob/main/RELEASES.md)
- [Commits](https://github.com/containerd/containerd/compare/v2.1.0-rc.0...v2.1.0-rc.1)

---
updated-dependencies:
- dependency-name: github.com/containerd/containerd/v2
  dependency-version: 2.1.0-rc.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-05-07 03:38:02 +00:00
Akihiro Suda f867f85fa9
Merge pull request #4204 from AkihiroSuda/gomodjail
go.mod: github.com/syndtr/gocapability: gomodjail:unconfined
2025-05-07 12:35:42 +09:00
Akihiro Suda 91739b7962
Merge pull request #3896 from Shubhranshu153/fix-logs-on-attach
fix: logs updated on starting of a stopped container
2025-05-07 12:35:29 +09:00
Akihiro Suda 2388dccf6e
go.mod: github.com/syndtr/gocapability: gomodjail:unconfined
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2025-05-07 12:28:17 +09:00
Akihiro Suda 4af3a5d4a6
Merge pull request #4199 from apostasie/2025-05-c1
[CI]: small fixes
2025-05-07 10:10:05 +09:00
Akihiro Suda 0cd6b6c2a0
Merge pull request #4196 from Shubhranshu153/fix-nerdctl-ps-filter
fix: nerdctl ps filter --status=created
2025-05-07 10:07:20 +09:00
Akihiro Suda ca64001ec8
Merge pull request #4200 from apostasie/2025-05-fix-4147
[CI]: rewrite TestLogsWithoutNewlineOrEOF
2025-05-07 10:02:51 +09:00
Akihiro Suda 998d13908e
Merge pull request #4198 from apostasie/2025-05-workaround-gmj
[CI]: workaround gomodjail concurrency issue
2025-05-07 10:00:31 +09:00
apostasie db57f37a02
Rewrite TestLogsWithoutNewlineOrEOF
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-05-06 12:46:34 -07:00
apostasie e65860255e
Increase timeout for windows on TestRunRmTime
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-05-06 11:07:39 -07:00
apostasie 2e81f21270
Integration in-container: simplify job
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-05-06 11:07:23 -07:00
Shubharanshu Mahapatra 65f4412ea5 fix: test nerdctl ps filter created.
Signed-off-by: Shubharanshu Mahapatra <shubhum@amazon.com>
2025-05-06 11:03:04 -07:00
apostasie 4039cfef3a
Workaround gomodjail concurrency issue
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-05-06 09:50:48 -07:00
Akihiro Suda 28d77b6349
Merge pull request #4197 from containerd/dependabot/go_modules/golang-x-c2498135d9
build(deps): bump the golang-x group with 6 updates
2025-05-06 20:21:10 +09:00
Akihiro Suda 45bc87f320
Merge pull request #4184 from fahedouch/refacto-and-fix-stats-showAll
fix: enhance event monitoring by adding close event channel
2025-05-06 19:16:31 +09:00
dependabot[bot] c30a057ef1
build(deps): bump the golang-x group with 6 updates
Bumps the golang-x group with 6 updates:

| Package | From | To |
| --- | --- | --- |
| [golang.org/x/crypto](https://github.com/golang/crypto) | `0.37.0` | `0.38.0` |
| [golang.org/x/net](https://github.com/golang/net) | `0.39.0` | `0.40.0` |
| [golang.org/x/sync](https://github.com/golang/sync) | `0.13.0` | `0.14.0` |
| [golang.org/x/sys](https://github.com/golang/sys) | `0.32.0` | `0.33.0` |
| [golang.org/x/term](https://github.com/golang/term) | `0.31.0` | `0.32.0` |
| [golang.org/x/text](https://github.com/golang/text) | `0.24.0` | `0.25.0` |


Updates `golang.org/x/crypto` from 0.37.0 to 0.38.0
- [Commits](https://github.com/golang/crypto/compare/v0.37.0...v0.38.0)

Updates `golang.org/x/net` from 0.39.0 to 0.40.0
- [Commits](https://github.com/golang/net/compare/v0.39.0...v0.40.0)

Updates `golang.org/x/sync` from 0.13.0 to 0.14.0
- [Commits](https://github.com/golang/sync/compare/v0.13.0...v0.14.0)

Updates `golang.org/x/sys` from 0.32.0 to 0.33.0
- [Commits](https://github.com/golang/sys/compare/v0.32.0...v0.33.0)

Updates `golang.org/x/term` from 0.31.0 to 0.32.0
- [Commits](https://github.com/golang/term/compare/v0.31.0...v0.32.0)

Updates `golang.org/x/text` from 0.24.0 to 0.25.0
- [Release notes](https://github.com/golang/text/releases)
- [Commits](https://github.com/golang/text/compare/v0.24.0...v0.25.0)

---
updated-dependencies:
- dependency-name: golang.org/x/crypto
  dependency-version: 0.38.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: golang-x
- dependency-name: golang.org/x/net
  dependency-version: 0.40.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: golang-x
- dependency-name: golang.org/x/sync
  dependency-version: 0.14.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: golang-x
- dependency-name: golang.org/x/sys
  dependency-version: 0.33.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: golang-x
- dependency-name: golang.org/x/term
  dependency-version: 0.32.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: golang-x
- dependency-name: golang.org/x/text
  dependency-version: 0.25.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: golang-x
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-05-05 23:40:23 +00:00
apostasie e64dc6b494
More defensive makefile
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-05-05 12:38:14 -07:00
apostasie bb85aae4a4
Add darwin to Makefile
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-05-05 12:33:23 -07:00
Akihiro Suda 63119fdfb6
Merge pull request #4188 from apostasie/ci-2025-05-summaries
[CI]: breakout 7: integration tests reports
2025-05-05 21:53:43 +09:00
Akihiro Suda 504a1e1939
Merge pull request #4195 from apostasie/2025-05-gomodjail-unconfine
[GOMODJAIL]: unconfine fsnotify and cdi
2025-05-05 21:52:59 +09:00
apostasie 742f6f1070
Gomodjail: unconfine fsnotify and cdi
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-05-04 18:56:55 -07:00
apostasie 16e231057e
Bump up timeout for lint-build
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-05-04 17:27:27 -07:00
apostasie 4c4feeb360
Adding summaries for CI workflows
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-05-04 17:27:25 -07:00
Akihiro Suda b957f47616
Merge pull request #4191 from apostasie/ci-2025-05-workflow-n2
[CI]: cleanup, breakout 6: separate jobs
2025-05-05 08:46:59 +09:00
apostasie 57d1718fff
GHA: rewrite in container integration workflow
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-05-04 09:13:19 -07:00
Akihiro Suda d74714f162
Merge pull request #4189 from apostasie/ci-2025-05-workflow-n1
[CI]: cleanup, breakout 5: separate jobs
2025-05-04 17:31:32 +09:00
Akihiro Suda ced5c8087f
Merge pull request #4190 from apostasie/cos-2025-05-target-error-display
[CI]: fix error output for target not found
2025-05-04 10:26:50 +09:00
apostasie 654e586501
Fix error output for target not found
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-05-03 09:10:08 -07:00
apostasie f4a9defc22
Refactor github workflows
This focused on cleaning-up integration testing, starting with freeBSD, EL, Docker, Windows.

Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-05-03 08:56:52 -07:00
Akihiro Suda 3839e03b0a
Merge pull request #4186 from apostasie/ci-2025-05-disable-net.core.somaxconn
[CI]: removing net.core.somaxconn from test
2025-05-03 20:04:39 +09:00
Akihiro Suda db9759cc29
Merge pull request #4187 from apostasie/ci-2025-05-el9-test-fix
[CI]: disable blkio test for older kernels
2025-05-03 16:48:07 +09:00
Akihiro Suda 944dbe6d3b
Merge pull request #4180 from apostasie/fix-gomodjail-integration
[FIX]: #4012 follow-ups (fixes and target test binaries)
2025-05-03 16:44:16 +09:00
apostasie 3ecc7f87fc
Disable blkio test for older kernels
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-05-02 16:10:03 -07:00
apostasie a5071dfc5d
Removing net.core.somaxconn from test
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-05-02 14:01:26 -07:00
fahed dorgaa 37ca1f4954
fix: enhance event monitoring by adding close event channel
Signed-off-by: fahed dorgaa <fahed.dorgaa@gmail.com>
2025-05-02 20:53:19 +02:00
apostasie 4dd9ad9b61
Follow-up to #4012: address tests issues
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-05-02 10:49:29 -07:00
Akihiro Suda c9eaf62784
Merge pull request #4179 from Shubhranshu153/feat-containerd-v2.1-migrate
feat: containerd v2.1 RC migrate.
2025-05-02 15:14:14 +09:00
Shubharanshu Mahapatra 2c91198bae fix: logs updated on starting of a stopped container
Signed-off-by: Shubharanshu Mahapatra <shubhum@amazon.com>
2025-05-01 22:57:35 -07:00
Akihiro Suda 1445a8a289
Merge pull request #4181 from apostasie/fix-2025-05-prepend-regression
[Regression] [Tigron]: fix prepend args
2025-05-02 13:27:48 +09:00
Shubharanshu Mahapatra 5aa54333aa feat: containerd v2.1 RC migrate.
Signed-off-by: Shubharanshu Mahapatra <shubhum@amazon.com>
2025-05-01 19:05:11 -07:00
apostasie e42002d844
Fix tigron prepend args regression
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-05-01 17:15:58 -07:00
Akihiro Suda 8d7539ab35
Merge pull request #4170 from djdongjin/carry-8525-add-cdi-support
[Carry #2280] Add support for CDI devices to device flag
2025-05-02 02:01:38 +09:00
Evan Lezar 71c646f147 Add support for CDI devices to device flag
This change adds support for specifying fully-qualified CDI device
names in the --device flag. This allows the Container Device Interface
(CDI) to be used to inject devices into container being run.

Signed-off-by: Evan Lezar <elezar@nvidia.com>

Enable cdi feature for Docker

Signed-off-by: Evan Lezar <elezar@nvidia.com>

Update go mod

Signed-off-by: Evan Lezar <elezar@nvidia.com>
Signed-off-by: Jin Dong <djdongjin95@gmail.com>

use containerd cdi.WithCDIDevices

Signed-off-by: Jin Dong <djdongjin95@gmail.com>
2025-05-01 10:17:37 -04:00
Kohei Tokunaga 08b4cfbbea
Merge pull request #4012 from AkihiroSuda/gomodjail
go.mod: experimental integration of gomodjail (library sandbox)
2025-05-01 19:30:32 +09:00
Akihiro Suda 81d830bf0b
go.mod: experimental integration of gomodjail (library sandbox)
https://github.com/AkihiroSuda/gomodjail

gomodjail imposes syscall restrictions on a specific set of Go modules (excepts ones that use unsafe pointers, reflections, etc.),
so as to mitigate their potential vulnerabilities and supply chain attack vectors.

Usage:
```
gomodjail run --go-mod=./go.mod -- nerdctl run hello-world
```

or

```
gomodjail pack --go-mod=./go.mod /usr/local/bin/nerdctl
./nerdctl.gomodjail run hello-world
```

Hint: use `git diff --word-diff` for reviewing the changes in this commit

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2025-05-01 18:03:31 +09:00
Kohei Tokunaga fb3b8c1b15
Merge pull request #4178 from AkihiroSuda/dev
update runc (1.3.0), CNI plugins (1.7.1), BuildKit (0.21.1), ...
2025-05-01 11:56:46 +09:00
Akihiro Suda 7496c6cb87
Merge pull request #4177 from apostasie/ci-2025-04-ci-cleanup-b4
[CI]: cleanup, breakout 4: separate jobs
2025-05-01 11:06:32 +09:00
Akihiro Suda b343bed91d
update Kubo (0.34.1)
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2025-05-01 11:05:46 +09:00
Akihiro Suda 5374d79c1a
update Nydus (2.3.1)
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2025-05-01 11:05:46 +09:00
Akihiro Suda ba6d7a3f69
update BuildKit (0.21.1)
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2025-05-01 11:05:46 +09:00
Akihiro Suda ea9519967f
update CNI plugins (1.7.1)
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2025-05-01 11:05:46 +09:00
Akihiro Suda 2d66497921
update runc (1.3.0)
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2025-05-01 11:05:42 +09:00
apostasie c364ee350c
Refactor lint workflows
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-04-30 16:52:22 -07:00
Akihiro Suda 6137211a6a
Merge pull request #4172 from fahedouch/refacto-and-fix-stats-showAll
fix stats for exited container and introduce some refacto
2025-05-01 08:48:56 +09:00
apostasie 3a3bebf57f
Harmonize variable names
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-04-30 16:15:39 -07:00
Akihiro Suda 2bd1b18bb8
Merge pull request #4161 from apostasie/ci-2025-04-ci-cleanup-b3
[CI]: cleanup, breakout 3: separate jobs
2025-05-01 08:12:17 +09:00
apostasie 20b67ddf9c
Enable rootful unit testing on linux
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-04-30 09:59:10 -07:00
apostasie 687aac55de
Refactor unit test workflow
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-04-30 09:52:42 -07:00
Akihiro Suda f289b99dbe
Merge pull request #4173 from apostasie/ci-2025-04-bust
[PRIORITY] [CI]: fix bustage
2025-04-30 09:04:07 +09:00
Akihiro Suda 32e1f5542c
Merge pull request #4160 from apostasie/ci-2025-04-ci-cleanup-b2
[CI]: cleanup, breakout 2: small cleanups and fixes
2025-04-30 09:03:28 +09:00
fahed dorgaa 017e286ff6
Merge pull request #4009 from SpiffyEight77/feat/support-logs-details
feat: add --details flag to logs command
2025-04-29 23:40:50 +02:00
apostasie 9dcda7baaf
Fix cache scope in EL8
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-04-29 14:28:15 -07:00
apostasie 2ba6eaba7b
Remove broken variable
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-04-29 14:28:13 -07:00
apostasie 3f2854af1e
Cleanup CI:setup-go
- remove useless .x suffixes
- consistently enforce check latest
- consitent step title

Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-04-29 14:28:04 -07:00
Akihiro Suda 9e058bb3ea
Merge pull request #4174 from containerd/dependabot/go_modules/go.uber.org/mock-0.5.2
build(deps): bump go.uber.org/mock from 0.5.1 to 0.5.2
2025-04-30 02:09:27 +09:00
Akihiro Suda b8d003efd3
Merge pull request #4175 from containerd/dependabot/github_actions/actions/attest-build-provenance-2.3.0
build(deps): bump actions/attest-build-provenance from 2.2.3 to 2.3.0
2025-04-30 02:04:12 +09:00
dependabot[bot] 85486757a9
build(deps): bump actions/attest-build-provenance from 2.2.3 to 2.3.0
Bumps [actions/attest-build-provenance](https://github.com/actions/attest-build-provenance) from 2.2.3 to 2.3.0.
- [Release notes](https://github.com/actions/attest-build-provenance/releases)
- [Changelog](https://github.com/actions/attest-build-provenance/blob/main/RELEASE.md)
- [Commits](c074443f1a...db473fddc0)

---
updated-dependencies:
- dependency-name: actions/attest-build-provenance
  dependency-version: 2.3.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-04-28 23:46:17 +00:00
dependabot[bot] d711af0045
build(deps): bump go.uber.org/mock from 0.5.1 to 0.5.2
Bumps [go.uber.org/mock](https://github.com/uber/mock) from 0.5.1 to 0.5.2.
- [Release notes](https://github.com/uber/mock/releases)
- [Changelog](https://github.com/uber-go/mock/blob/main/CHANGELOG.md)
- [Commits](https://github.com/uber/mock/compare/v0.5.1...v0.5.2)

---
updated-dependencies:
- dependency-name: go.uber.org/mock
  dependency-version: 0.5.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-04-28 23:37:53 +00:00
apostasie bf7312da45
Fix wrong number of lines reported
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-04-28 14:34:02 -07:00
apostasie d668068b23
Fix tigron CI bustage
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-04-28 14:33:48 -07:00
fahed dorgaa bcdb5eb487
fix stats for exited container and introduce some refacto
Signed-off-by: fahed dorgaa <fahed.dorgaa@gmail.com>
2025-04-28 10:47:11 +02:00
Ruihua Wen d8ef3665f6
feat: add --details flag to logs command
Signed-off-by: Ruihua Wen <spiffyeight77@gmail.com>
2025-04-28 15:47:12 +09:00
Akihiro Suda 012dbbd4cc
Merge pull request #4158 from containerd/dependabot/github_actions/docker/build-push-action-6.16.0
build(deps): bump docker/build-push-action from 6.15.0 to 6.16.0
2025-04-28 08:29:38 +09:00
Akihiro Suda 14d6355620
Merge pull request #4165 from apostasie/fix-2025-04-locking
[FIX]: tentatively fix concurrent access to locked CNI directory (#3783)
2025-04-28 08:28:51 +09:00
Akihiro Suda e062365e88
Merge pull request #4162 from ktock/buildg-v0.5
Bump up buildg to v0.5.2 and extend startup timeout
2025-04-28 08:28:19 +09:00
Jin Dong b8b59a99c8
Merge pull request #4164 from containerd/dependabot/go_modules/github.com/containernetworking/plugins-1.7.1
build(deps): bump github.com/containernetworking/plugins from 1.6.2 to 1.7.1
2025-04-26 18:06:43 -04:00
Kohei Tokunaga 5aaad8098e
Add --buildg-startup-timeout flag
This also extends buildg's default timeout value to 1m

Signed-off-by: Kohei Tokunaga <ktokunaga.mail@gmail.com>
2025-04-26 23:18:56 +09:00
Akihiro Suda a75f8a9762
Merge pull request #4166 from apostasie/fix-2025-04-loguri-debug
[QOL]: enhance error information for failing logURI
2025-04-26 10:42:19 +09:00
Akihiro Suda a84b0d7cc4
Merge pull request #4159 from apostasie/ci-2025-04-ci-cleanup-b1
[CI]: cleanup, breakout 1: `./hack`
2025-04-26 10:39:09 +09:00
apostasie 7e41456136
Move netutil flock to subdirectory
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-04-25 18:02:27 -07:00
apostasie b21a1c4acd
./hack cleanup
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-04-25 17:08:38 -07:00
apostasie 2760aa92b1
Enhance error information for failing logURI
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-04-25 15:56:55 -07:00
dependabot[bot] 0e6f3f2214
build(deps): bump github.com/containernetworking/plugins
Bumps [github.com/containernetworking/plugins](https://github.com/containernetworking/plugins) from 1.6.2 to 1.7.1.
- [Release notes](https://github.com/containernetworking/plugins/releases)
- [Commits](https://github.com/containernetworking/plugins/compare/v1.6.2...v1.7.1)

---
updated-dependencies:
- dependency-name: github.com/containernetworking/plugins
  dependency-version: 1.7.1
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-04-25 22:27:32 +00:00
Kohei Tokunaga 70fa10d205
Bump up buildg to v0.5.2
Signed-off-by: Kohei Tokunaga <ktokunaga.mail@gmail.com>
2025-04-25 23:27:57 +09:00
dependabot[bot] 93594d6ae9
build(deps): bump docker/build-push-action from 6.15.0 to 6.16.0
Bumps [docker/build-push-action](https://github.com/docker/build-push-action) from 6.15.0 to 6.16.0.
- [Release notes](https://github.com/docker/build-push-action/releases)
- [Commits](471d1dc4e0...14487ce63c)

---
updated-dependencies:
- dependency-name: docker/build-push-action
  dependency-version: 6.16.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-04-24 22:29:51 +00:00
Akihiro Suda 167325291c
Merge pull request #4115 from Shubhranshu153/fix-buildkit-host
fix: BUILDKIT_HOST env parsing when doing system prune
2025-04-24 13:12:40 +09:00
Akihiro Suda 105ca4d835
Merge pull request #4150 from manugupt1/provenance
Add provenance from github actions
2025-04-24 09:31:39 +09:00
Akihiro Suda d5f9634ce0
Merge pull request #4145 from apostasie/ci-2025-04-fix-testrunbindmountbind
[CI]: rewrite TestRunBindMountBind
2025-04-24 09:13:08 +09:00
Akihiro Suda 3f62a6f081
Merge pull request #4155 from apostasie/tigron-2025-04-shorten-max-log-length
[Tigron]: shorten max lines in logs to 50 and add message
2025-04-24 09:12:25 +09:00
apostasie c70adabf23
Shorten max lines in logs to 50 and add message
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-04-23 12:57:06 -07:00
Akihiro Suda 5c06c7d908
Merge pull request #4153 from fahedouch/fix-ci-vagrant-freebsd
Fix ci vagrant freebsd
2025-04-23 18:18:04 +09:00
fahed dorgaa 4372159017
fix: disable strict dependency enforcement for vagrant-libvirt plugin installation
Signed-off-by: fahed dorgaa <fahed.dorgaa@gmail.com>
2025-04-23 10:42:52 +02:00
Akihiro Suda 9daa9e9038
Merge pull request #4151 from containerd/dependabot/go_modules/github.com/compose-spec/compose-go/v2-2.6.1
build(deps): bump github.com/compose-spec/compose-go/v2 from 2.6.0 to 2.6.1
2025-04-23 11:12:27 +09:00
dependabot[bot] 66b6507cde
build(deps): bump github.com/compose-spec/compose-go/v2
Bumps [github.com/compose-spec/compose-go/v2](https://github.com/compose-spec/compose-go) from 2.6.0 to 2.6.1.
- [Release notes](https://github.com/compose-spec/compose-go/releases)
- [Commits](https://github.com/compose-spec/compose-go/compare/v2.6.0...v2.6.1)

---
updated-dependencies:
- dependency-name: github.com/compose-spec/compose-go/v2
  dependency-version: 2.6.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-04-22 23:00:18 +00:00
Manu Gupta b5d5f2f8cb Add provenance from github actions
Signed-off-by: Manu Gupta <manugupt1@gmail.com>
2025-04-22 08:36:19 -07:00
Akihiro Suda a33d0b2c6d
Merge pull request #3763 from slonopotamus/darwin
Darwin build
2025-04-22 02:43:58 +09:00
Akihiro Suda 4f54d76fdf
Merge pull request #4138 from apostasie/tigron-2025-04-x509-helper
[Tigron]: `x509` helper
2025-04-22 02:40:25 +09:00
Shubharanshu Mahapatra 95fc284342 fix: BUILDKIT_HOST env parsing
Signed-off-by: Shubharanshu Mahapatra <shubhum@amazon.com>
2025-04-21 08:40:45 -07:00
apostasie 15bb28ec18
Cleanup ca/ca.go and use new helper
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-04-21 08:35:09 -07:00
apostasie 16d755c4eb
Add x509 test helper
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-04-21 08:34:45 -07:00
Marat Radchenko 660c9a8aa2 darwin build
Closes #732

Signed-off-by: Marat Radchenko <marat@slonopotamus.org>
2025-04-21 10:32:51 +03:00
Akihiro Suda 8790faeabf
Merge pull request #4137 from apostasie/tigron-2025-04-data-save-to-writer
[Tigron]: `DataTemp.SaveToWriter` method
2025-04-21 15:06:11 +09:00
Akihiro Suda aa2ed30281
Merge pull request #4136 from apostasie/tigron-2025-04-contains-multi
[Tigron]: support multi-parameters for `expect.Contains` and `expect.DoesNotContain`
2025-04-21 15:04:56 +09:00
apostasie 2b6294dc3c
Add DataTemp.SaveToWriter
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-04-20 21:33:41 -07:00
apostasie 4e961136d5
Streamline tests to leverage Contain/DoesNotContain multi parameters
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-04-20 21:27:20 -07:00
apostasie 3878b011a7
Allow multiple needles in Contains and DoesNotContain
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-04-20 21:27:19 -07:00
Akihiro Suda 65658d30ef
Merge pull request #4139 from apostasie/tigron-2025-04-ci-timeout
[CI]: extend CI timeout for tigron on windows which occasionally goes over
2025-04-21 09:40:31 +09:00
Akihiro Suda 75e182c551
Merge pull request #4122 from apostasie/ci-rewrite-more-tests
[CI]: rewrite some container and compose tests
2025-04-21 09:38:10 +09:00
apostasie 594342ae6c
Rewrite TestRunBindMountBind
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-04-20 13:22:04 -07:00
Akihiro Suda 1a81a2052c
Merge pull request #4135 from apostasie/ci-bump-kind
[CI]: bump kind version 0.27
2025-04-20 05:20:48 +09:00
apostasie cda31f15e6
Extend CI timeout as windows fail
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-04-19 12:53:50 -07:00
apostasie 7bf2f01495
Bump kind version 0.27
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-04-19 10:00:16 -07:00
Akihiro Suda 5e8765b9c7
Merge pull request #4131 from containerd/dependabot/go_modules/docker-5ed7c3fb7c
build(deps): bump the docker group with 2 updates
2025-04-19 23:01:26 +09:00
Akihiro Suda f5eb085a86
Merge pull request #4134 from apostasie/flake-kube
Mark kube target as flaky
2025-04-19 20:35:59 +09:00
Akihiro Suda afc6490269
Merge pull request #4130 from apostasie/el8-timeout
[CI]: increase test timeout for EL8
2025-04-19 20:30:40 +09:00
apostasie b2855f7b95
Mark kube target as flaky
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-04-18 22:23:18 -07:00
dependabot[bot] 4a55331e12
build(deps): bump the docker group with 2 updates
Bumps the docker group with 2 updates: [github.com/docker/cli](https://github.com/docker/cli) and [github.com/docker/docker](https://github.com/docker/docker).


Updates `github.com/docker/cli` from 28.1.0+incompatible to 28.1.1+incompatible
- [Commits](https://github.com/docker/cli/compare/v28.1.0...v28.1.1)

Updates `github.com/docker/docker` from 28.1.0+incompatible to 28.1.1+incompatible
- [Release notes](https://github.com/docker/docker/releases)
- [Commits](https://github.com/docker/docker/compare/v28.1.0...v28.1.1)

---
updated-dependencies:
- dependency-name: github.com/docker/cli
  dependency-version: 28.1.1+incompatible
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: docker
- dependency-name: github.com/docker/docker
  dependency-version: 28.1.1+incompatible
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: docker
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-04-18 22:53:13 +00:00
apostasie 5cf3f80421
Increase test timeout for EL8
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-04-18 15:04:34 -07:00
Akihiro Suda 546e47663c
Merge pull request #4112 from apostasie/bump-deps
Bump CNI to 1.3 (and minor tooling versions)
2025-04-19 06:43:42 +09:00
apostasie ff8b599ae6
Modernize tests in container and compose
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-04-18 13:34:42 -07:00
Akihiro Suda 2aad180ca3
Merge pull request #4128 from apostasie/fix-main-bustage
[URGENT] Fixing main cross-merge bustage
2025-04-19 05:32:22 +09:00
apostasie 24c8654e4f
Fixing cross-merge failure
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-04-18 12:27:51 -07:00
Akihiro Suda dce438f118
Merge pull request #4052 from tushar5526/add-containers-to-inspect-output
feat: Add "Containers" propery in the "nerdctl network inspect" command.
2025-04-19 03:51:34 +09:00
Akihiro Suda b1f664617f
Merge pull request #4127 from apostasie/fix-bash
[PRIORITY] [CI]: Fix EL8 tests execution
2025-04-19 03:50:28 +09:00
Akihiro Suda d2b39639b0
Merge pull request #4121 from apostasie/fix-convert
[Fix]: image delete in convert (#3510)
2025-04-19 03:49:48 +09:00
apostasie 1bd12e8f67
Bump cni go dependency
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-04-18 08:39:47 -07:00
apostasie 7d6a6a79ff
Bump Dockerfile dependencies
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-04-18 08:39:46 -07:00
apostasie fcc15334a8
Fix image delete in convert
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-04-18 08:39:22 -07:00
apostasie aa03626e89
Fix EL8 tests execution
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-04-18 08:36:35 -07:00
Akihiro Suda e38cd0acdb
Merge pull request #4081 from apostasie/tigron-5-data
[Tigron]: revised Data interface
2025-04-19 00:17:57 +09:00
fahed dorgaa 9791bbca5f
Merge pull request #4125 from apostasie/bump-containerd-205
Update containerd to v2.0.5
2025-04-18 11:13:55 +01:00
Akihiro Suda c3b41b28ef
Merge pull request #4116 from apostasie/tigron-env
[Tigron]: allow per-command environment override
2025-04-18 16:45:45 +09:00
Akihiro Suda f9000f2416
Merge pull request #4124 from containerd/dependabot/go_modules/github.com/containerd/containerd/v2-2.0.5
build(deps): bump github.com/containerd/containerd/v2 from 2.0.4 to 2.0.5
2025-04-18 16:31:08 +09:00
Akihiro Suda 40d1835f66
Merge pull request #4123 from containerd/dependabot/go_modules/docker-c8760a323d
build(deps): bump the docker group with 2 updates
2025-04-18 16:30:28 +09:00
Akihiro Suda 362252e745
Merge pull request #4114 from apostasie/fix-command-test
[CI]: fix internal command flaky test (window)
2025-04-18 16:29:00 +09:00
Akihiro Suda df5fc78748
Merge pull request #4111 from apostasie/ci-fix-debug
[CI]: quality of life: minor debugging output fixes
2025-04-18 16:24:56 +09:00
Akihiro Suda 32c65c6709
Merge pull request #4078 from swagatbora90/cpu_rt_options
feat: add cpu-rt-period and cpu-rt-runtime options in nerdctl create/run
2025-04-18 16:21:30 +09:00
apostasie a7a0ae7859
Update containerd to v2.0.5
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-04-17 15:30:51 -07:00
dependabot[bot] f74502d3c5
build(deps): bump github.com/containerd/containerd/v2
Bumps [github.com/containerd/containerd/v2](https://github.com/containerd/containerd) from 2.0.4 to 2.0.5.
- [Release notes](https://github.com/containerd/containerd/releases)
- [Changelog](https://github.com/containerd/containerd/blob/main/RELEASES.md)
- [Commits](https://github.com/containerd/containerd/compare/v2.0.4...v2.0.5)

---
updated-dependencies:
- dependency-name: github.com/containerd/containerd/v2
  dependency-version: 2.0.5
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-04-17 22:13:38 +00:00
dependabot[bot] 7cab413cfe
build(deps): bump the docker group with 2 updates
Bumps the docker group with 2 updates: [github.com/docker/cli](https://github.com/docker/cli) and [github.com/docker/docker](https://github.com/docker/docker).


Updates `github.com/docker/cli` from 28.0.4+incompatible to 28.1.0+incompatible
- [Commits](https://github.com/docker/cli/compare/v28.0.4...v28.1.0)

Updates `github.com/docker/docker` from 28.0.4+incompatible to 28.1.0+incompatible
- [Release notes](https://github.com/docker/docker/releases)
- [Commits](https://github.com/docker/docker/compare/v28.0.4...v28.1.0)

---
updated-dependencies:
- dependency-name: github.com/docker/cli
  dependency-version: 28.1.0+incompatible
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: docker
- dependency-name: github.com/docker/docker
  dependency-version: 28.1.0+incompatible
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: docker
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-04-17 22:13:23 +00:00
apostasie 0d492a27bc
Update tests to use modified tigron
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-04-17 14:16:48 -07:00
apostasie 3f21c04aa9
test.Data to support temp resources manipulation
Many tests require temporary resources (Dockerfiles, compose.yml, etc), and routinely
redo the same thing over and over (create separate temp dir, write file, remove temp dir).
At best this adds a lot of inconsistent boilerplate / helper functions to the test - at worst,
the resources are not properly cleaned-up, or not well isolated from other tests.

This PR does introduce a set of helpers to fasttrack temp files manipulation, and rejiggle the
Data interface to more clearly separate labels (shared with subtests) and temporary resources.

Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-04-17 14:16:37 -07:00
apostasie d88b9df182
Allow per-command environment override
While test allow declaration of custom environment variables, they must be set during the test
declaration, apply to all commands, and cannot be altered during lifecycle operations (eg: Setup).
This provides the ability to set variables for specific, individual commands.

Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-04-16 19:02:38 -07:00
apostasie 1b44f934b7
Fix internal command flaky test (window)
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-04-16 10:50:19 -07:00
apostasie d439da9f06
Implement env whitelist to reduce debug noise
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-04-16 08:44:16 -07:00
apostasie 330ddf4a68
Cosmetic fixes for testing debug logs
- fix timeout showing 0s instead of default when no explicit timeout is provided
- add actual execution time
- fix long logs (stdout, stderr) that were showing only the beginning to also show the end
- fix formatting issue for "..."
- marginally better output for command contextual information

Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-04-16 08:44:15 -07:00
Akihiro Suda 88c6393cfd
Merge pull request #4107 from apostasie/fix-not-found
[FIX]: fix issues in rmi code (including #4104 content digest not found)
2025-04-16 15:34:29 +09:00
Akihiro Suda 0cc1f0c637
Merge pull request #4064 from containerd/dependabot/github_actions/crazy-max/ghaction-github-runtime-3.1.0
build(deps): bump crazy-max/ghaction-github-runtime from 3.0.0 to 3.1.0
2025-04-16 15:34:04 +09:00
Akihiro Suda f64f3833e9
Merge pull request #4102 from apostasie/fix-canary
[CI]: fix canary version matching
2025-04-16 11:33:41 +09:00
Akihiro Suda dc2bdefa1e
Merge pull request #4105 from apostasie/tigron-doc
[DOC]: mod/tigron/require documentation
2025-04-16 11:33:31 +09:00
apostasie 086cef0e8e
Fix image removal
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-04-15 15:52:54 -07:00
Tushar Gupta a7d46bcfdf feat: Add "Containers" propery in the "nerdctl network inspect" command.
Signed-off-by: Tushar Gupta <codingid6@gmail.com>
2025-04-15 23:16:51 +05:30
Akihiro Suda fa64898ce2
Merge pull request #3961 from weiyuhang2011/fix-inspect
fix: inspect should return one array rather than a stream of array
2025-04-15 16:48:57 +09:00
Akihiro Suda c02abf5439
Merge pull request #4080 from apostasie/tigron-4-require
[Tigron]: Testing logs user experience
2025-04-15 14:05:47 +09:00
apostasie 000a4b5e1c
mod/tigron/require documentation
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-04-14 15:54:16 -07:00
apostasie 488e1e7824
Enhanced test debug information
Finishing prior effort to make test run easier to debug, this introduces a number of changes to the output:
- high-contrast emojis to make it easier to spot relevant sections
- 2 columns table formatting for commands informations
- better spacing
- lifecycle sections (cleanup, setup, run)
- clearly called out assertive output

Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-04-14 15:46:20 -07:00
apostasie e2a004858a
Cleaner debug information for assertive
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-04-14 15:46:20 -07:00
apostasie 384bf14a52
Deprecate info in comparators
The extra info parameter makes it so that all command debugging information is printed-out for every assert.
Since command debugging information will now be logged separately, this is now un-necessary.
A later PR will change the API and remove the parameter entirely from test.Comparator.

Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-04-14 15:46:19 -07:00
apostasie 23b8420938
Mark t.Helper() to avoid reporting wrong source info on failure
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-04-14 15:46:18 -07:00
Akihiro Suda 3a35911c34
Merge pull request #4079 from apostasie/tigron-3-json-comparator
[Tigron]: expect.JSON comparator and updated volume test
2025-04-15 07:12:02 +09:00
apostasie 9255358df8
Adjust command test
In some cases, exec is just really slow.
Adjusting tests so that we start counting after the command actually started.

Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-04-14 11:03:03 -07:00
apostasie 36c304f2b7
Migrate Volume test to use expect.JSON
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-04-14 11:03:01 -07:00
apostasie b5e5dabab6
Add expect.JSON comparator
This changeset adds expect.JSON[T any], which will allow easier testing of json output and hopefully
remove a lot of boilerplate unmarshalling / assert in tests.

It also adds an extensive doc.md document about comparators (plan is trim down the main documentation
to a small set of simple examples, then link to these "advanced" docs for further reading), which
will allow for easier documentation maintenance and more approachable reading.

Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-04-14 11:02:56 -07:00
apostasie 88a5640954
Fix canary version matching
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-04-14 09:18:26 -07:00
Yuhang Wei a46b5678e1 test(inspect): validate combined container and image inspect output
`nerdctl inspect <container> <image>` should return a single JSON array
containing both the container and image inspect results. This unit test
parses the output and compares it with the results of separate `inspect`
commands to ensure correctness.

Signed-off-by: Yuhang Wei <weiyuhang2011@gmail.com>
2025-04-14 21:00:12 +08:00
Yuhang Wei 609fe3b5a2 fix: inspect should return one array rather than a stream of array
Signed-off-by: Yuhang Wei <weiyuhang2011@gmail.com>
2025-04-14 20:54:12 +08:00
Akihiro Suda d3cb96ebf4
Merge pull request #4077 from apostasie/tigron-2-debugging
[Tigron]: command env WhiteList support and cosmetic changes
2025-04-14 09:02:07 +09:00
apostasie 734f7a18d3
Cosmetic cleanup and linting
This is mostly a cosmetic changeset:
- refined golangcilint, explicitly calling which linters we really care about, along with settings for revive
- comments on reasons for some of //nolint
- comments line breaks
- additional FIXME information
- assert type check fixes
- const-ification
- overall making linter happy(-ier)

Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-04-13 11:32:44 -07:00
apostasie cece0a9e06
Add environment WhiteList support for Command + prefix matching
Prior, only BlackList-ing of environment variables was supported, and solely for exact variable names match, or "*" for all.

This changeset introduces:
- WhiteList-ing
- prefix matching for env var names (eg: "THING_*" can now be used to white/black list any env variable which name starts with THING_)

Note that whitelisting takes precedence over blacklisting if both are used.

Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-04-13 10:47:58 -07:00
Akihiro Suda 9570d200dd
Merge pull request #4099 from ark-j/main
Fix stopping container when setup using setuid bit
2025-04-13 03:41:17 +09:00
Akihiro Suda 625b67493f
Merge pull request #4076 from apostasie/tigron-1-mock
[Tigron]: mocks + debugging output enhancements
2025-04-12 21:01:54 +09:00
dependabot[bot] e6dbb2165a
build(deps): bump crazy-max/ghaction-github-runtime from 3.0.0 to 3.1.0
Bumps [crazy-max/ghaction-github-runtime](https://github.com/crazy-max/ghaction-github-runtime) from 3.0.0 to 3.1.0.
- [Release notes](https://github.com/crazy-max/ghaction-github-runtime/releases)
- [Commits](b3a9207c0e...3cb05d89e1)

---
updated-dependencies:
- dependency-name: crazy-max/ghaction-github-runtime
  dependency-version: 3.1.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-04-12 09:24:05 +00:00
fahed dorgaa 268aae81e3
Merge pull request #4063 from coderbirju/update-containr-top
fix: Pass ps_args as option to container top
2025-04-11 21:52:47 +01:00
apostasie 33836f6d87
Assertive enhancements
This brings a set of enhancements to assertive:
- function name simplifications
- generics-ifying of some functions that can be used on comparables
- additional methods (Match, DoesNotMatch)
- debugging output is made clear, along with OCS8 link and excerpt of the test file
- all methods can now elect to Fail later instead of FailNow
- Check method is removed (^ because of above)
- all methods can now elect to silence output on success

Other Tigron files are updated to adopt these changes:
- method names update
- comparators move away from Check and now fully leverages assertive

This also adds a large number of tests for assertive, leveraging mimicry.

Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-04-11 09:43:48 -07:00
apostasie e3a4c70239
Adding mimicry (internal mock mechanism)
Mimicry is a lightweight, zero dependency mock mechanism created to ease testing of Tigron.
Since Tigron heavily relies on *testing.T, it is currently hard to test.
Moving away to a tig.T interface instead of *testing.T will unlock the ability to mock.
Mimicry does provide:
- recording of all function calls, with arguments and complete stack trace (see Report())
- optional custom handling of function calls (see Register())
- QOL: fancyfied OCS8 links allow opening files from traces in terminal

UX is largely in flux right now and experimental, but the objective is to:
- do not require code generation
- do not abuse reflection
- keep the amount of boilerplate to the absolute minimum for the mock consumer
- ... and as small as possible for the mock creator
- keep zero dependencies

This commit also introduce the tig.T interface to be used everywhere inside Tigron in the future,
along with a complete mock for it.

Mimicry is not meant to be used directly for now, though, if there is interest, a future
version might graduate out of `internal`.

Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-04-11 09:43:35 -07:00
Jayesh Kale 0bf31d0a67 (fix) stopping container when setup using setuid bit
when nerdctl setup to run `setuid bit`,
nerdctl failed to execute `container stop` command.
the fix is to add the checks for uid and euid.
for more information refer this issue https://github.com/containerd/nerdctl/issues/4098

fix ci freebsd and windows build

removed irrelevant changes and added addtional information for change

removed runtime linux check for os build file

Signed-off-by: Jayesh Kale <jayesh6297@gmail.com>
2025-04-11 21:24:35 +05:30
apostasie 2def90d0be
Update golangci
This commit relaxes line length from 100 to 120, and disables a bunch of linters we do not want.

Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-04-11 08:40:51 -07:00
Akihiro Suda 83d5173d55
Merge pull request #4100 from containerd/dependabot/go_modules/github.com/compose-spec/compose-go/v2-2.6.0
build(deps): bump github.com/compose-spec/compose-go/v2 from 2.5.0 to 2.6.0
2025-04-11 08:32:42 +09:00
dependabot[bot] a166568916
build(deps): bump github.com/compose-spec/compose-go/v2
Bumps [github.com/compose-spec/compose-go/v2](https://github.com/compose-spec/compose-go) from 2.5.0 to 2.6.0.
- [Release notes](https://github.com/compose-spec/compose-go/releases)
- [Commits](https://github.com/compose-spec/compose-go/compare/v2.5.0...v2.6.0)

---
updated-dependencies:
- dependency-name: github.com/compose-spec/compose-go/v2
  dependency-version: 2.6.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-04-10 22:04:14 +00:00
Swagat Bora 33f1d2805d feat: add cpu-rt-period and cpu-rt-runtime options in nerdctl create/run
Signed-off-by: Swagat Bora <sbora@amazon.com>
2025-04-10 17:26:06 +00:00
Akihiro Suda 9d0a76671b
Merge pull request #4096 from AkihiroSuda/fix-4094
CI: FreeBSD: fix "No packages available to install matching ..."
2025-04-10 14:39:16 +09:00
Akihiro Suda e6283c06a0
CI: FreeBSD: fix "No packages available to install matching ..."
Fix issue 4094

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2025-04-10 11:30:29 +09:00
Akihiro Suda 8d8c8eb7c0
Merge pull request #4072 from containerd/dependabot/go_modules/github.com/compose-spec/compose-go/v2-2.5.0
build(deps): bump github.com/compose-spec/compose-go/v2 from 2.4.9 to 2.5.0
2025-04-10 10:45:33 +09:00
Akihiro Suda dc834a3df2
Merge pull request #4056 from apostasie/ci-tigron-cmd
[CI] new command implementation for tests
2025-04-08 19:18:11 +09:00
dependabot[bot] 2ec878c393
build(deps): bump github.com/compose-spec/compose-go/v2
Bumps [github.com/compose-spec/compose-go/v2](https://github.com/compose-spec/compose-go) from 2.4.9 to 2.5.0.
- [Release notes](https://github.com/compose-spec/compose-go/releases)
- [Commits](https://github.com/compose-spec/compose-go/compare/v2.4.9...v2.5.0)

---
updated-dependencies:
- dependency-name: github.com/compose-spec/compose-go/v2
  dependency-version: 2.5.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-04-08 08:32:01 +00:00
Akihiro Suda c0233beecb
Merge pull request #4093 from containerd/dependabot/go_modules/go.uber.org/mock-0.5.1
build(deps): bump go.uber.org/mock from 0.5.0 to 0.5.1
2025-04-08 17:30:02 +09:00
Akihiro Suda 743b32554c
Merge pull request #4092 from containerd/dependabot/go_modules/github.com/pelletier/go-toml/v2-2.2.4
build(deps): bump github.com/pelletier/go-toml/v2 from 2.2.3 to 2.2.4
2025-04-08 17:28:48 +09:00
dependabot[bot] a30633be12
build(deps): bump go.uber.org/mock from 0.5.0 to 0.5.1
Bumps [go.uber.org/mock](https://github.com/uber/mock) from 0.5.0 to 0.5.1.
- [Release notes](https://github.com/uber/mock/releases)
- [Changelog](https://github.com/uber-go/mock/blob/main/CHANGELOG.md)
- [Commits](https://github.com/uber/mock/compare/v0.5.0...v0.5.1)

---
updated-dependencies:
- dependency-name: go.uber.org/mock
  dependency-version: 0.5.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-04-08 07:32:06 +00:00
Akihiro Suda 28d30c36ae
Merge pull request #4090 from containerd/dependabot/go_modules/golang-x-e2728388d4
build(deps): bump the golang-x group with 6 updates
2025-04-08 16:30:27 +09:00
dependabot[bot] 390af3e05e
build(deps): bump github.com/pelletier/go-toml/v2 from 2.2.3 to 2.2.4
Bumps [github.com/pelletier/go-toml/v2](https://github.com/pelletier/go-toml) from 2.2.3 to 2.2.4.
- [Release notes](https://github.com/pelletier/go-toml/releases)
- [Changelog](https://github.com/pelletier/go-toml/blob/v2/.goreleaser.yaml)
- [Commits](https://github.com/pelletier/go-toml/compare/v2.2.3...v2.2.4)

---
updated-dependencies:
- dependency-name: github.com/pelletier/go-toml/v2
  dependency-version: 2.2.4
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-04-07 23:14:22 +00:00
dependabot[bot] 1540091d07
build(deps): bump the golang-x group with 6 updates
Bumps the golang-x group with 6 updates:

| Package | From | To |
| --- | --- | --- |
| [golang.org/x/crypto](https://github.com/golang/crypto) | `0.36.0` | `0.37.0` |
| [golang.org/x/net](https://github.com/golang/net) | `0.38.0` | `0.39.0` |
| [golang.org/x/sync](https://github.com/golang/sync) | `0.12.0` | `0.13.0` |
| [golang.org/x/sys](https://github.com/golang/sys) | `0.31.0` | `0.32.0` |
| [golang.org/x/term](https://github.com/golang/term) | `0.30.0` | `0.31.0` |
| [golang.org/x/text](https://github.com/golang/text) | `0.23.0` | `0.24.0` |


Updates `golang.org/x/crypto` from 0.36.0 to 0.37.0
- [Commits](https://github.com/golang/crypto/compare/v0.36.0...v0.37.0)

Updates `golang.org/x/net` from 0.38.0 to 0.39.0
- [Commits](https://github.com/golang/net/compare/v0.38.0...v0.39.0)

Updates `golang.org/x/sync` from 0.12.0 to 0.13.0
- [Commits](https://github.com/golang/sync/compare/v0.12.0...v0.13.0)

Updates `golang.org/x/sys` from 0.31.0 to 0.32.0
- [Commits](https://github.com/golang/sys/compare/v0.31.0...v0.32.0)

Updates `golang.org/x/term` from 0.30.0 to 0.31.0
- [Commits](https://github.com/golang/term/compare/v0.30.0...v0.31.0)

Updates `golang.org/x/text` from 0.23.0 to 0.24.0
- [Release notes](https://github.com/golang/text/releases)
- [Commits](https://github.com/golang/text/compare/v0.23.0...v0.24.0)

---
updated-dependencies:
- dependency-name: golang.org/x/crypto
  dependency-version: 0.37.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: golang-x
- dependency-name: golang.org/x/net
  dependency-version: 0.39.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: golang-x
- dependency-name: golang.org/x/sync
  dependency-version: 0.13.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: golang-x
- dependency-name: golang.org/x/sys
  dependency-version: 0.32.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: golang-x
- dependency-name: golang.org/x/term
  dependency-version: 0.31.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: golang-x
- dependency-name: golang.org/x/text
  dependency-version: 0.24.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: golang-x
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-04-07 23:04:54 +00:00
Akihiro Suda 6092e0b1c6
Merge pull request #4073 from yankay/fix-profile-in-compose
Fix: `env_file` in compose work with profile
2025-04-07 03:57:21 +01:00
Akihiro Suda fca0a02459
Merge pull request #4085 from fahedouch/bump-go-logrotate
bump go-logrotate to v0.3.0
2025-04-07 03:55:25 +01:00
fahed dorgaa 0dd3552406
Merge pull request #4083 from biubiubiuboomboomboom/fix/hardcode-in-testcase
[CI] fix hardcode in TestImageHistory
2025-04-07 00:01:51 +01:00
fahed dorgaa 5f6102ccaa
Merge pull request #4086 from containerd/dependabot/go_modules/github.com/fsnotify/fsnotify-1.9.0
build(deps): bump github.com/fsnotify/fsnotify from 1.8.0 to 1.9.0
2025-04-06 23:47:19 +01:00
fahed dorgaa a43a2e04cc
Merge pull request #4062 from apostasie/qa-fixes
[P0] Fix #3513 (`[MAJOR] content digest not found`)
2025-04-06 09:10:45 +01:00
dependabot[bot] e40aae9332
build(deps): bump github.com/fsnotify/fsnotify from 1.8.0 to 1.9.0
Bumps [github.com/fsnotify/fsnotify](https://github.com/fsnotify/fsnotify) from 1.8.0 to 1.9.0.
- [Release notes](https://github.com/fsnotify/fsnotify/releases)
- [Changelog](https://github.com/fsnotify/fsnotify/blob/main/CHANGELOG.md)
- [Commits](https://github.com/fsnotify/fsnotify/compare/v1.8.0...v1.9.0)

---
updated-dependencies:
- dependency-name: github.com/fsnotify/fsnotify
  dependency-version: 1.9.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-04-04 23:00:32 +00:00
fahed dorgaa b9043ff9a0
update go-logrotate to v0.3.0
Signed-off-by: fahed dorgaa <fahed.dorgaa@gmail.com>
2025-04-04 23:55:17 +02:00
fahed dorgaa 87a9f52da3
Merge pull request #4084 from apostasie/fix-fahedouch-owes-me-a-beer-in-paris
Fix logging regression
2025-04-04 21:04:22 +01:00
apostasie 4f1d307de3
Fix logging regression.
Trim prefix part of containerd socket address.

Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-04-04 11:49:10 -07:00
y.li d1b827a982 add parallel
Signed-off-by: y.li <prestonkelsie434@gmail.com>
2025-04-05 00:00:33 +08:00
y.li 4efae1649b ltag
Signed-off-by: y.li <prestonkelsie434@gmail.com>
2025-04-04 22:42:47 +08:00
y.li 8318437f07 fix hardcode in TestImageHistory
Signed-off-by: y.li <prestonkelsie434@gmail.com>
2025-04-04 21:26:50 +08:00
Kay Yan 8b06f2ac54
Fix env_file in compose work with profile
Signed-off-by: Kay Yan <kay.yan@daocloud.io>
2025-04-03 12:49:06 +00:00
fahed dorgaa 7efb818d19
Merge pull request #4070 from zzzzzzzzzy9/test-run-td
test for nerdctl run -t -d
2025-04-02 12:18:02 +01:00
zzzzzzzzzy9 625445f3f9 test for run -td
Signed-off-by: zzzzzzzzzy9 <zhang.yu58@zte.com.cn>
2025-04-02 16:48:12 +08:00
fahed dorgaa fe688ce159
Merge pull request #4065 from apostasie/ci-mute-stargztest
[P2] [CI] mute noisy test pull logs
2025-04-02 00:22:28 +02:00
apostasie e77c56163c
Update tests to adopt tooling changes
- Background
- Feed, WithFeeder, WithPseudoTTY
- use exit code consts where appropriate
- some --quiet

Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-04-01 09:32:40 -07:00
apostasie d9cd8f5eb2
Adapt nerdtest to updated tigron
- Background() signature change
- command creation change

Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-04-01 09:32:39 -07:00
apostasie 761330e60a
Enable leak detection for tests under test
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-04-01 09:32:39 -07:00
apostasie cb8668df89
Adapt tooling to the new command implementation
- use internal/com instead of icmd
- move pty from test/internal to internal
- update go mod, sum, and depguard

Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-04-01 09:32:38 -07:00
apostasie 37d4d289c3
Enhance comparators debugging info
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-04-01 09:32:37 -07:00
apostasie 0896078df4
Add new command implementation
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-04-01 09:32:37 -07:00
apostasie 423fc1fc0a
CI: quiet run output
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-04-01 09:32:35 -07:00
apostasie 751c1eb5a1
Fix content digest not found
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-04-01 09:28:36 -07:00
apostasie 26fb66fe73
Mute noisy test pull logs
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-04-01 09:28:06 -07:00
Akihiro Suda 00558aabc8
Merge pull request #4058 from apostasie/nerdctl-drifting
[P0] [CI] Adjust drifting test
2025-04-01 16:42:17 +01:00
Arjun Raja Yogidas 710dfceea1 fix: Pass ps_args as option to container top
Signed-off-by: Arjun Raja Yogidas <arjunry@amazon.com>
2025-03-31 17:12:56 +00:00
apostasie aab2d506a0
Adjust drifting test for another year
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-03-30 11:47:04 -07:00
Akihiro Suda 14c10b1fb9
Merge pull request #4051 from apostasie/ci-golangci-v2-post
[CI] golangci v2: review, fix, document, rules
2025-03-31 02:40:50 +09:00
apostasie 46c6af6e11
Lint: staticcheck review remaining checks
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-03-30 09:22:08 -07:00
apostasie 1298c20fb6
Lint: staticcheck fix ST1005
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-03-30 09:22:07 -07:00
apostasie a46718f702
Lint: staticcheck fix QF1004
Note that QF1009 has been fixed by previous commits working on revive.

Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-03-30 09:22:07 -07:00
apostasie 8893fe4121
Lint: revive: review and organization off all rules
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-03-30 09:22:06 -07:00
apostasie 77b0edc861
Lint: revive import-alias-naming
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-03-30 09:22:05 -07:00
apostasie 702a97740d
Lint: revive filename-format
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-03-30 09:22:05 -07:00
apostasie bc989da454
Lint: revive if-return
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-03-30 09:22:04 -07:00
apostasie ebc89dc071
Lint: revive unexported-naming
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-03-30 09:22:03 -07:00
apostasie 4e3f637a1b
Lint: revive time-equal
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-03-30 09:22:02 -07:00
apostasie 39d5ef2860
Lint: revive struct-tag
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-03-30 09:22:02 -07:00
apostasie 1b3b183af8
Lint: revive redundant-import-alias
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-03-30 09:22:01 -07:00
apostasie 6f658816aa
golangci yml configuration cleanup
- re-activate gocritic, disabling rules we do not pass
- disable prealloc (considered harmful)
- activate golines formatter
- comment and re-orgnize linters section

Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-03-30 09:21:59 -07:00
Akihiro Suda 833710207d
Merge pull request #4047 from apostasie/ci-tigron-break-5
[CI] Tigron breakout 5: enable lint and tests on the CI
2025-03-31 00:45:52 +09:00
Akihiro Suda e47acc347e
Merge pull request #4054 from apostasie/fix-raw
[fix] Avoid console SetRaw
2025-03-31 00:42:56 +09:00
Akihiro Suda 0881ccb367
Merge pull request #4055 from apostasie/fix-win-cni
[CI] Update wincni
2025-03-31 00:41:52 +09:00
Akihiro Suda 1837b2f1f7
Merge pull request #4048 from apostasie/ci-golangci-v2
[CI] Update golangci to v2
2025-03-31 00:41:00 +09:00
apostasie 46af33e18a
Update wincni
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-03-29 07:31:35 -07:00
apostasie a1dc0e28da
Avoid console SetRaw
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-03-28 16:30:29 -07:00
apostasie 303faac4bc
Enabling tigron lint and test on the CI
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-03-28 12:03:16 -07:00
apostasie 994190af9a
Update golangci to v2
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-03-28 09:37:23 -07:00
Akihiro Suda ae29b3b5d3
Merge pull request #4049 from containerd/dependabot/go_modules/golang-x-bbb8b02913
build(deps): bump golang.org/x/net from 0.37.0 to 0.38.0 in the golang-x group
2025-03-28 11:34:51 +09:00
Akihiro Suda d79175b699
Merge pull request #4045 from apostasie/ci-tigron-break-4
[CI] Tigron breakout 4: adding a few tests
2025-03-28 10:53:04 +09:00
dependabot[bot] 6b83b6b129
build(deps): bump golang.org/x/net in the golang-x group
Bumps the golang-x group with 1 update: [golang.org/x/net](https://github.com/golang/net).

Updates `golang.org/x/net` from 0.37.0 to 0.38.0
- [Commits](https://github.com/golang/net/compare/v0.37.0...v0.38.0)

---
updated-dependencies:
- dependency-name: golang.org/x/net
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: golang-x
...

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2025-03-28 10:02:43 +09:00
apostasie 2df29b7cf1
Adding tigron tests
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-03-27 11:02:12 -07:00
Akihiro Suda c57654bfae
Merge pull request #4044 from apostasie/ci-tigron-break-3
[CI] Tigron breakout 3: leak detection
2025-03-28 02:15:04 +09:00
apostasie c9c90d9c9f
Adding internal leak detection lib
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-03-27 08:59:44 -07:00
Akihiro Suda 5bfe6ebfe1
Merge pull request #4042 from apostasie/ci-tigron-break-2
[CI] Tigron breakout 2: remove gotest.tools assert dependency internally
2025-03-28 00:51:54 +09:00
apostasie 4ad52bc096
Migrate away from assert to internal assertive
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-03-27 07:49:10 -07:00
apostasie 7cc4257564
Add assertive lib
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-03-27 07:49:08 -07:00
Akihiro Suda 3a6ceb225a
Merge pull request #4041 from apostasie/ci-tigron-break-1
[CI] Tigron breakout: golangci v2 and cleanups
2025-03-27 16:42:19 +09:00
Akihiro Suda 0190e8184a
Merge pull request #4039 from containerd/dependabot/go_modules/github.com/containerd/nydus-snapshotter-0.15.1
build(deps): bump github.com/containerd/nydus-snapshotter from 0.15.0 to 0.15.1
2025-03-27 16:18:05 +09:00
apostasie a92e93c144
Cosmetic fixes
- satisfy updated golangci-lint
- simplify code
- simplify func signatures
- enhance documentation a bit

Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-03-26 23:11:17 -07:00
Akihiro Suda 1c63395bf5
Merge pull request #4038 from containerd/dependabot/go_modules/docker-d0ba34ced2
build(deps): bump the docker group with 2 updates
2025-03-27 15:09:35 +09:00
apostasie 2db910590a
Makefile cleanup and update
- update to golangci v2
- remove dependency on go-imports-reviser (in favor of golangci provided gci)
- remove useless tasks
- remove hack make-license

Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-03-26 22:52:54 -07:00
dependabot[bot] a257f62e2b
build(deps): bump github.com/containerd/nydus-snapshotter
Bumps [github.com/containerd/nydus-snapshotter](https://github.com/containerd/nydus-snapshotter) from 0.15.0 to 0.15.1.
- [Release notes](https://github.com/containerd/nydus-snapshotter/releases)
- [Commits](https://github.com/containerd/nydus-snapshotter/compare/v0.15.0...v0.15.1)

---
updated-dependencies:
- dependency-name: github.com/containerd/nydus-snapshotter
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-03-26 22:34:31 +00:00
dependabot[bot] 233285b25e
build(deps): bump the docker group with 2 updates
Bumps the docker group with 2 updates: [github.com/docker/cli](https://github.com/docker/cli) and [github.com/docker/docker](https://github.com/docker/docker).


Updates `github.com/docker/cli` from 28.0.2+incompatible to 28.0.4+incompatible
- [Commits](https://github.com/docker/cli/compare/v28.0.2...v28.0.4)

Updates `github.com/docker/docker` from 28.0.2+incompatible to 28.0.4+incompatible
- [Release notes](https://github.com/docker/docker/releases)
- [Commits](https://github.com/docker/docker/compare/v28.0.2...v28.0.4)

---
updated-dependencies:
- dependency-name: github.com/docker/cli
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: docker
- dependency-name: github.com/docker/docker
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: docker
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-03-26 22:34:22 +00:00
Akihiro Suda 3f7a7a87f5
Merge pull request #4007 from Shubhranshu153/feat-add-env-to-inspect
add env and user to inspect in dockercompat
2025-03-26 10:33:10 +09:00
Akihiro Suda f57f872374
Merge pull request #4030 from apostasie/ci-clone-1
Dockerfile git clones to be quiet and shallow
2025-03-21 23:47:48 +09:00
apostasie c66f8ebf66
Dockerfile git clones to be quiet and shallow
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-03-20 12:04:18 -07:00
Shubharanshu Mahapatra bbf2ab73b5 add user to inspect
Signed-off-by: Shubharanshu Mahapatra <shubhum@amazon.com>
2025-03-20 10:27:09 -07:00
Shubharanshu Mahapatra dc79e90541 add env to inspect
Signed-off-by: Shubharanshu Mahapatra <shubhum@amazon.com>
2025-03-20 10:25:38 -07:00
Akihiro Suda 39058fbce6
Merge pull request #3950 from swagatbora90/blkio-options
Add support for remaining blkio settings
2025-03-20 23:59:38 +09:00
Akihiro Suda 63b566f858
Merge pull request #4026 from containerd/dependabot/github_actions/actions/setup-go-5.4.0
build(deps): bump actions/setup-go from 5.3.0 to 5.4.0
2025-03-20 23:57:17 +09:00
Akihiro Suda 13a3622304
Merge pull request #4017 from AkihiroSuda/dev
update slirp4netns (1.3.2), containerd (2.0.4), runc (1.2.6)...; verify the git tags with the commit hashes
2025-03-20 23:56:01 +09:00
fahed dorgaa b9e2e81f5d
Merge pull request #4024 from containerd/dependabot/go_modules/docker-015c50991f
build(deps): bump the docker group with 2 updates
2025-03-20 10:43:06 +01:00
fahed dorgaa f2e5e45277
Merge pull request #4025 from containerd/dependabot/github_actions/actions/cache-4.2.3
build(deps): bump actions/cache from 4.2.2 to 4.2.3
2025-03-20 10:41:28 +01:00
dependabot[bot] 4ae6381673
build(deps): bump actions/setup-go from 5.3.0 to 5.4.0
Bumps [actions/setup-go](https://github.com/actions/setup-go) from 5.3.0 to 5.4.0.
- [Release notes](https://github.com/actions/setup-go/releases)
- [Commits](f111f3307d...0aaccfd150)

---
updated-dependencies:
- dependency-name: actions/setup-go
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-03-19 22:20:42 +00:00
dependabot[bot] 3bb5bedde1
build(deps): bump actions/cache from 4.2.2 to 4.2.3
Bumps [actions/cache](https://github.com/actions/cache) from 4.2.2 to 4.2.3.
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](d4323d4df1...5a3ec84eff)

---
updated-dependencies:
- dependency-name: actions/cache
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-03-19 22:20:38 +00:00
dependabot[bot] 8aff7f7e48
build(deps): bump the docker group with 2 updates
Bumps the docker group with 2 updates: [github.com/docker/cli](https://github.com/docker/cli) and [github.com/docker/docker](https://github.com/docker/docker).


Updates `github.com/docker/cli` from 28.0.1+incompatible to 28.0.2+incompatible
- [Commits](https://github.com/docker/cli/compare/v28.0.1...v28.0.2)

Updates `github.com/docker/docker` from 28.0.1+incompatible to 28.0.2+incompatible
- [Release notes](https://github.com/docker/docker/releases)
- [Commits](https://github.com/docker/docker/compare/v28.0.1...v28.0.2)

---
updated-dependencies:
- dependency-name: github.com/docker/cli
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: docker
- dependency-name: github.com/docker/docker
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: docker
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-03-19 22:15:59 +00:00
Akihiro Suda f48f720532
Merge pull request #4020 from containerd/dependabot/go_modules/github.com/containerd/imgcrypt/v2-2.0.1
build(deps): bump github.com/containerd/imgcrypt/v2 from 2.0.0 to 2.0.1
2025-03-20 02:52:22 +09:00
Akihiro Suda 65f44c6934
update containerd (2.0.4), etc.; verify the git tags with the commit hashes
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2025-03-19 22:33:23 +09:00
dependabot[bot] 48d42673b0
build(deps): bump github.com/containerd/imgcrypt/v2 from 2.0.0 to 2.0.1
Bumps [github.com/containerd/imgcrypt/v2](https://github.com/containerd/imgcrypt) from 2.0.0 to 2.0.1.
- [Release notes](https://github.com/containerd/imgcrypt/releases)
- [Changelog](https://github.com/containerd/imgcrypt/blob/main/CHANGES)
- [Commits](https://github.com/containerd/imgcrypt/compare/v2.0.0...v2.0.1)

---
updated-dependencies:
- dependency-name: github.com/containerd/imgcrypt/v2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-03-19 13:02:37 +00:00
Akihiro Suda fe82600b02
Merge pull request #4010 from ningmingxiao/fix_ps
fix nerdctl ps show nothing when timeout
2025-03-19 17:57:13 +09:00
ningmingxiao 0b97695007 fix:nerdctl ps show nothing when timeout
Signed-off-by: ningmingxiao <ning.mingxiao@zte.com.cn>
2025-03-19 15:34:46 +08:00
Akihiro Suda 021b7c9efe
Merge pull request #4014 from containerd/dependabot/go_modules/github.com/containerd/containerd/v2-2.0.4
build(deps): bump github.com/containerd/containerd/v2 from 2.0.3 to 2.0.4
2025-03-18 13:56:26 +09:00
Akihiro Suda e44d3af100
Merge pull request #3994 from abel-von/add-sync-for-commit
add sync syscall before get container diff when commit
2025-03-18 13:00:37 +09:00
Akihiro Suda de58809d47
Merge pull request #4015 from coderbirju/update-dockercompat-inspect
fix: Return empty network settings for non started containers
2025-03-18 12:08:56 +09:00
Arjun Raja Yogidas 9aecbf3b00 fix: Return empty network settings for non started containers
Signed-off-by: Arjun Raja Yogidas <arjunry@amazon.com>
2025-03-17 22:18:33 +00:00
dependabot[bot] 59c439e54b
build(deps): bump github.com/containerd/containerd/v2
Bumps [github.com/containerd/containerd/v2](https://github.com/containerd/containerd) from 2.0.3 to 2.0.4.
- [Release notes](https://github.com/containerd/containerd/releases)
- [Changelog](https://github.com/containerd/containerd/blob/main/RELEASES.md)
- [Commits](https://github.com/containerd/containerd/compare/v2.0.3...v2.0.4)

---
updated-dependencies:
- dependency-name: github.com/containerd/containerd/v2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-03-17 18:09:27 +00:00
Akihiro Suda 8a36f5b5b1
Merge pull request #4008 from containerd/dependabot/github_actions/docker/login-action-3.4.0
build(deps): bump docker/login-action from 3.3.0 to 3.4.0
2025-03-18 03:04:57 +09:00
Swagat Bora dd9e8ce77d Add support for remaining blkio settings
Also adds HostConfig inspect tests and skip unsupported docker tests

Signed-off-by: Swagat Bora <sbora@amazon.com>
2025-03-17 16:14:38 +00:00
dependabot[bot] 7bd097b33c
build(deps): bump docker/login-action from 3.3.0 to 3.4.0
Bumps [docker/login-action](https://github.com/docker/login-action) from 3.3.0 to 3.4.0.
- [Release notes](https://github.com/docker/login-action/releases)
- [Commits](9780b0c442...74a5d14239)

---
updated-dependencies:
- dependency-name: docker/login-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-03-14 22:46:55 +00:00
Akihiro Suda d13fb45e33
Merge pull request #4002 from Shubhranshu153/fix-none-logger
fix: none log driver creating log uri
2025-03-14 12:26:22 +09:00
Akihiro Suda 74a5a6ad04
Merge pull request #4006 from containerd/dependabot/go_modules/github.com/compose-spec/compose-go/v2-2.4.9
build(deps): bump github.com/compose-spec/compose-go/v2 from 2.4.8 to 2.4.9
2025-03-14 12:25:35 +09:00
dependabot[bot] 27bcb6eb54
build(deps): bump github.com/compose-spec/compose-go/v2
Bumps [github.com/compose-spec/compose-go/v2](https://github.com/compose-spec/compose-go) from 2.4.8 to 2.4.9.
- [Release notes](https://github.com/compose-spec/compose-go/releases)
- [Commits](https://github.com/compose-spec/compose-go/compare/v2.4.8...v2.4.9)

---
updated-dependencies:
- dependency-name: github.com/compose-spec/compose-go/v2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-03-13 22:36:19 +00:00
Jin Dong 497c7cf74d
Merge pull request #3985 from apostasie/ci-build-accel-3
CI, build 3: Stop sharding cache on containerd version
2025-03-13 14:12:14 -04:00
Jin Dong 11122f5459
Merge pull request #4003 from austinvazquez/update-buildkit
Dockerfile: update buildkit to 0.20.1
2025-03-13 10:51:29 -04:00
apostasie bd7cbb380a
Stop sharding cache per containerd version
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-03-12 17:37:14 -07:00
fahed dorgaa 29de58e0a0
Merge pull request #4001 from apostasie/fix-3761
Remove golanci-lint action
2025-03-12 23:54:18 +01:00
Austin Vazquez 99d03ee848
Dockerfile: update buildkit to 0.20.1
Signed-off-by: Austin Vazquez <macedonv@amazon.com>
2025-03-12 20:43:38 +00:00
apostasie cc81c720f4
Remove golanci-lint action
Depending on the action means depending on a precompiled version of it that is incompatible with updated golang versions.
Alternatively, the action offers to build it from source, but unfortunately, the specific GOOS has to apply for both
the compilation and verification stages.

The action also performs additional steps (--verify) that are unnecessary and have been a source of issues.

Finally, golangci-lint version has to be maintained in two distinct places:
- local developer environment
- github CI side

Removing the action in favor of calling `make install-dev-tools` will fix these issues.

Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-03-12 08:56:17 -07:00
Shubharanshu Mahapatra 3fbb8be5fc fix: none log dirver creating log uri
Signed-off-by: Shubharanshu Mahapatra <shubhum@amazon.com>
2025-03-11 10:03:20 -07:00
fahed dorgaa 0d7f52c7b1
Merge pull request #3989 from apostasie/fix-3988
CI: update Canary and EL8 titles
2025-03-11 12:42:17 +01:00
apostasie 430c57c5d3
Update Canary and EL8 titles
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-03-10 12:20:11 -07:00
Akihiro Suda 1838cd8b7b
Merge pull request #3999 from AkihiroSuda/dev
update RootlessKit (2.3.4)
2025-03-10 17:56:16 +09:00
Akihiro Suda 1d3725633e
update RootlessKit (2.3.4)
Needed to support Ubuntu 25.04

https://github.com/rootless-containers/rootlesskit/releases/tag/v2.3.3
https://github.com/rootless-containers/rootlesskit/releases/tag/v2.3.4

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2025-03-10 11:20:30 +09:00
Akihiro Suda 7df4f3d8c1
Merge pull request #3995 from fahedouch/carry-shutdown-logger-after-exits
[carry #2337] ensure logger completion after container exit
2025-03-10 09:55:24 +09:00
Jin Dong e450a1c961
Merge pull request #3997 from AkihiroSuda/refactor-dockerfile-goversion
Dockerfile: remove "goversion" stage
2025-03-08 19:12:42 -05:00
fahed dorgaa 27b91ecf75
ensure logger completion after container exit
Introduced mechanisms to ensure logger completion after container exit using file locks and added robust handling for log streams. Updated and added tests to validate functionality, including log behavior with running, non-terminated, and restarted containers.

Signed-off-by: fahed dorgaa <fahed.dorgaa@gmail.com>
2025-03-08 22:59:12 +01:00
Abel Feng 24aa5e4153 add sync syscall before get container diff when commit
Signed-off-by: Abel Feng <fshb1988@gmail.com>
2025-03-07 17:12:31 +08:00
Akihiro Suda e33a85f9b5
Dockerfile: remove "goversion" stage
No need to fetch `https://golang.org/dl/$(cat /GOVERSION)...`
when we can just copy `/usr/local/go` from the `golang:${GO_VERSION}` image.

Alternative to PR 3986

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2025-03-07 16:43:07 +09:00
Akihiro Suda 8eb594a10b
Merge pull request #3990 from containerd/dependabot/go_modules/golang-x-a843e1bb67
build(deps): bump the golang-x group across 1 directory with 6 updates
2025-03-07 15:38:35 +09:00
Akihiro Suda 92e37dbf08
Merge pull request #3984 from apostasie/ci-build-accel-2
CI, build 2: Move GHA to zstd
2025-03-07 15:35:36 +09:00
apostasie 98a531a20c
Move GHA to zstd compression
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-03-06 20:51:33 -08:00
Akihiro Suda 18182b3cd4
Merge pull request #3983 from apostasie/ci-build-accel-1
CI, build 1: disable buildx output for dependency stage
2025-03-07 10:47:35 +09:00
dependabot[bot] bc4642a448
build(deps): bump the golang-x group across 1 directory with 6 updates
Bumps the golang-x group with 2 updates in the / directory: [golang.org/x/crypto](https://github.com/golang/crypto) and [golang.org/x/net](https://github.com/golang/net).


Updates `golang.org/x/crypto` from 0.35.0 to 0.36.0
- [Commits](https://github.com/golang/crypto/compare/v0.35.0...v0.36.0)

Updates `golang.org/x/net` from 0.35.0 to 0.37.0
- [Commits](https://github.com/golang/net/compare/v0.35.0...v0.37.0)

Updates `golang.org/x/sync` from 0.11.0 to 0.12.0
- [Commits](https://github.com/golang/sync/compare/v0.11.0...v0.12.0)

Updates `golang.org/x/sys` from 0.30.0 to 0.31.0
- [Commits](https://github.com/golang/sys/compare/v0.30.0...v0.31.0)

Updates `golang.org/x/term` from 0.29.0 to 0.30.0
- [Commits](https://github.com/golang/term/compare/v0.29.0...v0.30.0)

Updates `golang.org/x/text` from 0.22.0 to 0.23.0
- [Release notes](https://github.com/golang/text/releases)
- [Commits](https://github.com/golang/text/compare/v0.22.0...v0.23.0)

---
updated-dependencies:
- dependency-name: golang.org/x/crypto
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: golang-x
- dependency-name: golang.org/x/net
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: golang-x
- dependency-name: golang.org/x/sync
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: golang-x
- dependency-name: golang.org/x/sys
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: golang-x
- dependency-name: golang.org/x/term
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: golang-x
- dependency-name: golang.org/x/text
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: golang-x
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-03-06 22:36:00 +00:00
Kohei Tokunaga 2feac61a07
Merge pull request #3978 from AkihiroSuda/verify-no-patent
Replace hack/verify-no-patent.sh with depguard
2025-03-06 18:20:18 +09:00
fahed dorgaa 31b4e49db7
Merge pull request #3993 from AkihiroSuda/lima-actions
CI: simplify setting up Lima
2025-03-06 10:00:46 +01:00
Akihiro Suda dbbf636f11
Merge pull request #3973 from apostasie/brush-off-matrix
CI: implement updated test matrix
2025-03-06 17:18:05 +09:00
Akihiro Suda 47f1b9ec9c
Merge pull request #3964 from apostasie/ci-kill-pull-noise
--quiet image pulls in tests
2025-03-06 17:16:41 +09:00
Akihiro Suda f19eb5a3c6
CI: simplify setting up Lima
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2025-03-06 14:51:04 +09:00
Akihiro Suda 7505c3f524
Replace hack/verify-no-patent.sh with depguard
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2025-03-06 11:26:03 +09:00
Akihiro Suda 2f9a4f62d1
Merge pull request #3940 from apostasie/analyze-dockerfile
Adding document analyzing CI/dockerfile
2025-03-06 09:47:20 +09:00
Akihiro Suda bd79675cf8
Merge pull request #3979 from apostasie/ci-TestStopWithStopSignal
Increase wait for ensurecontainerstarted
2025-03-06 09:38:23 +09:00
Akihiro Suda 264ccfb144
Merge pull request #3977 from apostasie/fix-license-tasl
Fix broken lint-license make task
2025-03-06 09:36:10 +09:00
fahed dorgaa 8814decb03
Merge pull request #3981 from apostasie/fix-3980
Fix 3980
2025-03-05 17:43:03 +01:00
apostasie e52580ee17
Adding document analyzing CI/dockerfile
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-03-04 18:31:19 -08:00
apostasie f790122887
Disable buildx output for dependency stage
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-03-04 15:47:34 -08:00
apostasie 3daef1cb59
Implement updated test matrix
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-03-04 10:03:11 -08:00
apostasie 699c850996
Fix broken lint-license task
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-03-04 10:02:32 -08:00
apostasie 9182ea4ead
Increase wait for ensurecontainerstarted
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-03-04 10:02:12 -08:00
apostasie a81136c212
Fix kubectl download url
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-03-04 10:00:54 -08:00
apostasie bd5bcca491
Fix referenceutil.FamiliarMatch SIGSEGV
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-03-04 10:00:29 -08:00
Akihiro Suda e79def42e2
Merge pull request #3976 from AkihiroSuda/project-checks
Update containerd/project-checks (1.2.2)
2025-03-05 01:51:38 +09:00
Akihiro Suda ce10c9226e
Update containerd/project-checks (1.2.2)
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2025-03-04 23:19:34 +09:00
Akihiro Suda 59b9599a17
Merge pull request #3965 from apostasie/fix-alma
CI: fix alma targets
2025-03-04 13:49:19 +09:00
apostasie d80c2cf441
Fix alma ci target
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-03-03 19:47:07 -08:00
Jin Dong 67969b680b
Merge pull request #3968 from containerd/dependabot/go_modules/github.com/opencontainers/image-spec-1.1.1
build(deps): bump github.com/opencontainers/image-spec from 1.1.0 to 1.1.1
2025-03-03 22:15:18 -05:00
Jin Dong 53a22caa52
Merge pull request #3970 from apostasie/minor-apt-cleanup
CI: trivial github action cleanup
2025-03-03 21:58:29 -05:00
Akihiro Suda aeac380731
Merge pull request #3967 from containerd/dependabot/github_actions/actions/cache-4.2.2
build(deps): bump actions/cache from 4.2.1 to 4.2.2
2025-03-04 11:38:19 +09:00
apostasie 34e44e7b06
Migrate TestRunDevice test
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-03-03 18:13:46 -08:00
apostasie d9a0e87bd4
Quiet out apt-get calls
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-03-03 18:12:32 -08:00
apostasie 0296acd3ec
Use makefile task to install golangci
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-03-03 18:11:00 -08:00
dependabot[bot] 0b606c7f72
build(deps): bump github.com/opencontainers/image-spec
Bumps [github.com/opencontainers/image-spec](https://github.com/opencontainers/image-spec) from 1.1.0 to 1.1.1.
- [Release notes](https://github.com/opencontainers/image-spec/releases)
- [Changelog](https://github.com/opencontainers/image-spec/blob/main/RELEASES.md)
- [Commits](https://github.com/opencontainers/image-spec/compare/v1.1.0...v1.1.1)

---
updated-dependencies:
- dependency-name: github.com/opencontainers/image-spec
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-03-03 22:48:59 +00:00
dependabot[bot] 121c656f1f
build(deps): bump actions/cache from 4.2.1 to 4.2.2
Bumps [actions/cache](https://github.com/actions/cache) from 4.2.1 to 4.2.2.
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](https://github.com/actions/cache/compare/v4.2.1...d4323d4df104b026a6aa633fdb11d772146be0bf)

---
updated-dependencies:
- dependency-name: actions/cache
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-03-03 22:15:53 +00:00
apostasie 678822a9c6
--quiet image pulls in tests
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-03-03 12:35:53 -08:00
Kohei Tokunaga 088fe02ec3
Merge pull request #3904 from AkihiroSuda/drop-ubuntu-20.04
CI: drop Ubuntu 20.04, add AlmaLinux 8
2025-03-03 23:38:35 +09:00
Akihiro Suda f364f2422f
Merge pull request #3910 from apostasie/sub-project-testing-3
CI: test framework, part III
2025-03-03 21:53:30 +09:00
Akihiro Suda e08cb3557b
Merge pull request #3960 from apostasie/fix-test
Fix test TestNoneNetworkHostName
2025-03-03 21:52:15 +09:00
Akihiro Suda 4d76aa96b4
CI: drop Ubuntu 20.04, add AlmaLinux 8
The ubuntu-20.04 runner is being deprecated on GHA:
actions/runner-images issue 11101

AlmaLinux 8 can be still used for running the tests with cgroup v1.

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2025-03-03 20:34:46 +09:00
Akihiro Suda a85ee2b195
Merge pull request #3962 from fahedouch/rollback-set-up-vagrant-comment-ci
[ci] rollback setup vagrant comment
2025-03-03 19:31:24 +09:00
fahed dorgaa 147ebca47a
[ci] rollback setup vagrant comment
Signed-off-by: fahed dorgaa <fahed.dorgaa@gmail.com>
2025-03-03 10:25:06 +01:00
apostasie 6d3c49a795
Fix test TestNoneNetworkHostName
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-03-02 20:02:55 -08:00
apostasie 62c1565bf8
Add golangci and yamllint to tigron
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-03-02 19:18:49 -08:00
apostasie 077558c897
Lint fixes
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-03-02 19:18:49 -08:00
apostasie 7f04990549
Move to creack pty
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-03-02 19:18:48 -08:00
apostasie 0020c91252
Makefile fixes
- enable freebsd tasks
- use ORG_PREFIXES consistently

Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-03-02 19:18:39 -08:00
Akihiro Suda a9487804eb
Merge pull request #3958 from apostasie/qemu
Add qemu/rosetta notes
2025-03-03 11:55:58 +09:00
apostasie ea685aed39
Add qemu/rosetta notes
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-03-02 18:32:46 -08:00
Akihiro Suda 892a8bb70d
Merge pull request #3944 from apostasie/refactor-cleanup-1
Cleanup/refactor proposal
2025-03-03 10:17:38 +09:00
Akihiro Suda 4c8e2f8c08
Merge pull request #3946 from apostasie/fix-3945
Fix apparmor host check to include aa-parser
2025-03-03 10:15:50 +09:00
Akihiro Suda 3ac75b4c21
Merge pull request #3953 from apostasie/fix-TestIssue3568
Harden test pty error handling
2025-03-03 10:14:13 +09:00
fahed dorgaa 52caaebd67
Merge pull request #3954 from apostasie/update-container-2.0.3
Update to containerd v2.0.3
2025-03-01 22:14:25 +01:00
apostasie 8af2e4c29c
Update containerd v2.0.3
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-03-01 10:24:42 -08:00
Jin Dong 499f905195
Merge pull request #3915 from apostasie/ci-golangci-disable-config-validation 2025-03-01 09:59:18 -05:00
Jin Dong a57c66c602
Merge pull request #3796 from containerd/dependabot/go_modules/github.com/containernetworking/plugins-1.6.2
build(deps): bump github.com/containernetworking/plugins from 1.5.1 to 1.6.2
2025-02-28 23:18:25 -05:00
dependabot[bot] e58ceaa622
build(deps): bump github.com/containernetworking/plugins
Bumps [github.com/containernetworking/plugins](https://github.com/containernetworking/plugins) from 1.5.1 to 1.6.2.
- [Release notes](https://github.com/containernetworking/plugins/releases)
- [Commits](https://github.com/containernetworking/plugins/compare/v1.5.1...v1.6.2)

---
updated-dependencies:
- dependency-name: github.com/containernetworking/plugins
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-03-01 03:39:43 +00:00
Jin Dong 08625b9543
Merge pull request #3956 from containerd/dependabot/go_modules/github.com/containerd/containerd/v2-2.0.3
build(deps): bump github.com/containerd/containerd/v2 from 2.0.2 to 2.0.3
2025-02-28 22:37:34 -05:00
dependabot[bot] d432a4a100
build(deps): bump github.com/containerd/containerd/v2
Bumps [github.com/containerd/containerd/v2](https://github.com/containerd/containerd) from 2.0.2 to 2.0.3.
- [Release notes](https://github.com/containerd/containerd/releases)
- [Changelog](https://github.com/containerd/containerd/blob/main/RELEASES.md)
- [Commits](https://github.com/containerd/containerd/compare/v2.0.2...v2.0.3)

---
updated-dependencies:
- dependency-name: github.com/containerd/containerd/v2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-03-01 00:23:32 +00:00
Jin Dong b779dfb0b5
Merge pull request #3955 from containerd/dependabot/github_actions/docker/setup-qemu-action-3.6.0
build(deps): bump docker/setup-qemu-action from 3.5.0 to 3.6.0
2025-02-28 19:23:31 -05:00
Jin Dong 5c254a6b83
Merge pull request #3957 from containerd/dependabot/go_modules/github.com/opencontainers/runtime-spec-1.2.1
build(deps): bump github.com/opencontainers/runtime-spec from 1.2.0 to 1.2.1
2025-02-28 19:22:23 -05:00
dependabot[bot] ca1fd3cb86
build(deps): bump github.com/opencontainers/runtime-spec
Bumps [github.com/opencontainers/runtime-spec](https://github.com/opencontainers/runtime-spec) from 1.2.0 to 1.2.1.
- [Release notes](https://github.com/opencontainers/runtime-spec/releases)
- [Changelog](https://github.com/opencontainers/runtime-spec/blob/main/ChangeLog)
- [Commits](https://github.com/opencontainers/runtime-spec/compare/v1.2.0...v1.2.1)

---
updated-dependencies:
- dependency-name: github.com/opencontainers/runtime-spec
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-02-28 22:31:31 +00:00
dependabot[bot] 37e5e59de9
build(deps): bump docker/setup-qemu-action from 3.5.0 to 3.6.0
Bumps [docker/setup-qemu-action](https://github.com/docker/setup-qemu-action) from 3.5.0 to 3.6.0.
- [Release notes](https://github.com/docker/setup-qemu-action/releases)
- [Commits](5964de0df5...29109295f8)

---
updated-dependencies:
- dependency-name: docker/setup-qemu-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-02-28 22:25:45 +00:00
apostasie 898e3e46c8
Harden test pty error handling
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-02-28 12:28:25 -08:00
apostasie e21e4b2c13
Cleaning variables and function names in cmd
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-02-28 11:42:36 -08:00
apostasie 0e88305660
Fix apparmor host check to include aa-parser
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-02-28 10:14:16 -08:00
Akihiro Suda 22c4c4f63a
Merge pull request #3949 from containerd/dependabot/github_actions/actions/cache-4.2.2
build(deps): bump actions/cache from 4.2.1 to 4.2.2
2025-02-28 12:31:17 +09:00
Akihiro Suda 891c52029d
Merge pull request #3943 from apostasie/oups
Rename NO_COLORS
2025-02-28 12:30:46 +09:00
Akihiro Suda 1efb637137
Merge pull request #3947 from coderbirju/add-hosts-path
add hostsPath to inspect response
2025-02-28 12:30:20 +09:00
Akihiro Suda d5bed8b294
Merge pull request #3812 from coderbirju/add-hostconfig-inspect-response
Add HostConfig to `nerdctl inspect` response
2025-02-28 12:24:12 +09:00
dependabot[bot] a5a7f18149
build(deps): bump actions/cache from 4.2.1 to 4.2.2
Bumps [actions/cache](https://github.com/actions/cache) from 4.2.1 to 4.2.2.
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](0c907a75c2...d4323d4df1)

---
updated-dependencies:
- dependency-name: actions/cache
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-02-27 22:44:28 +00:00
Arjun Raja Yogidas 5220350d77 add hostsPath to inspect response
Signed-off-by: Arjun Raja Yogidas <arjunry@amazon.com>
2025-02-27 21:33:34 +00:00
apostasie 88e9c5d9b3
Rename NO_COLORS
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-02-27 08:46:27 -08:00
Jin Dong 24bb81a308
Merge pull request #3934 from apostasie/ci-remove-isolation-hack
Enforce pkg isolation as part of golangci
2025-02-26 21:15:13 -05:00
apostasie 715cb0c2c3
Enforce pkg isolation as part of golangci
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-02-26 17:32:38 -08:00
Akihiro Suda 1fd291f937
Merge pull request #3916 from apostasie/ci-make-tasks
CI: spring cleaning Makefile
2025-02-27 09:58:40 +09:00
Akihiro Suda d3072780b5
Merge pull request #3890 from apostasie/sub-project-testing-2
CI: test framework, part II
2025-02-27 09:55:18 +09:00
Akihiro Suda 00ad410418
Merge pull request #3939 from containerd/dependabot/go_modules/docker-63d65c2b33
build(deps): bump the docker group with 2 updates
2025-02-27 09:28:12 +09:00
Akihiro Suda 5018038817
Merge pull request #3938 from containerd/dependabot/github_actions/docker/metadata-action-5.7.0
build(deps): bump docker/metadata-action from 5.6.1 to 5.7.0
2025-02-27 09:27:40 +09:00
Akihiro Suda 4ecab8c445
Merge pull request #3937 from containerd/dependabot/github_actions/docker/build-push-action-6.15.0
build(deps): bump docker/build-push-action from 6.14.0 to 6.15.0
2025-02-27 09:27:19 +09:00
Akihiro Suda 52dbfb6e60
Merge pull request #3936 from containerd/dependabot/github_actions/docker/setup-qemu-action-3.5.0
build(deps): bump docker/setup-qemu-action from 3.4.0 to 3.5.0
2025-02-27 09:27:00 +09:00
Akihiro Suda 2eb7753d18
Merge pull request #3935 from containerd/dependabot/github_actions/docker/setup-buildx-action-3.10.0
build(deps): bump docker/setup-buildx-action from 3.9.0 to 3.10.0
2025-02-27 09:26:41 +09:00
Akihiro Suda 3cde4e8cc2
Merge pull request #3933 from apostasie/fix-3932
Fix kube-hide-dupe docs typo
2025-02-27 09:26:19 +09:00
Akihiro Suda 7276365f48
Merge pull request #3922 from containerd/dependabot/go_modules/golang-x-ee7f9554a6
build(deps): bump golang.org/x/crypto from 0.33.0 to 0.35.0 in the golang-x group
2025-02-27 09:25:54 +09:00
dependabot[bot] f99a5635d9
build(deps): bump the docker group with 2 updates
Bumps the docker group with 2 updates: [github.com/docker/cli](https://github.com/docker/cli) and [github.com/docker/docker](https://github.com/docker/docker).


Updates `github.com/docker/cli` from 28.0.0+incompatible to 28.0.1+incompatible
- [Commits](https://github.com/docker/cli/compare/v28.0.0...v28.0.1)

Updates `github.com/docker/docker` from 28.0.0+incompatible to 28.0.1+incompatible
- [Release notes](https://github.com/docker/docker/releases)
- [Commits](https://github.com/docker/docker/compare/v28.0.0...v28.0.1)

---
updated-dependencies:
- dependency-name: github.com/docker/cli
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: docker
- dependency-name: github.com/docker/docker
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: docker
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-02-26 22:13:38 +00:00
dependabot[bot] d52eaf3e5c
build(deps): bump docker/metadata-action from 5.6.1 to 5.7.0
Bumps [docker/metadata-action](https://github.com/docker/metadata-action) from 5.6.1 to 5.7.0.
- [Release notes](https://github.com/docker/metadata-action/releases)
- [Commits](369eb591f4...902fa8ec7d)

---
updated-dependencies:
- dependency-name: docker/metadata-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-02-26 22:13:16 +00:00
dependabot[bot] 166ace9617
build(deps): bump docker/build-push-action from 6.14.0 to 6.15.0
Bumps [docker/build-push-action](https://github.com/docker/build-push-action) from 6.14.0 to 6.15.0.
- [Release notes](https://github.com/docker/build-push-action/releases)
- [Commits](0adf995921...471d1dc4e0)

---
updated-dependencies:
- dependency-name: docker/build-push-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-02-26 22:13:15 +00:00
dependabot[bot] 18e52416c8
build(deps): bump docker/setup-qemu-action from 3.4.0 to 3.5.0
Bumps [docker/setup-qemu-action](https://github.com/docker/setup-qemu-action) from 3.4.0 to 3.5.0.
- [Release notes](https://github.com/docker/setup-qemu-action/releases)
- [Commits](4574d27a47...5964de0df5)

---
updated-dependencies:
- dependency-name: docker/setup-qemu-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-02-26 22:13:12 +00:00
dependabot[bot] 14b3ace117
build(deps): bump docker/setup-buildx-action from 3.9.0 to 3.10.0
Bumps [docker/setup-buildx-action](https://github.com/docker/setup-buildx-action) from 3.9.0 to 3.10.0.
- [Release notes](https://github.com/docker/setup-buildx-action/releases)
- [Commits](f7ce87c1d6...b5ca514318)

---
updated-dependencies:
- dependency-name: docker/setup-buildx-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-02-26 22:13:09 +00:00
apostasie 44b8b584da
Fix kube-hide-dupe docs typo
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-02-26 08:23:20 -08:00
dependabot[bot] ef92eec557
build(deps): bump golang.org/x/crypto in the golang-x group
Bumps the golang-x group with 1 update: [golang.org/x/crypto](https://github.com/golang/crypto).

Updates `golang.org/x/crypto` from 0.33.0 to 0.35.0
- [Commits](https://github.com/golang/crypto/compare/v0.33.0...v0.35.0)

---
updated-dependencies:
- dependency-name: golang.org/x/crypto
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: golang-x
...

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2025-02-26 16:26:40 +09:00
apostasie 4b765cd8c0
Reorg test package
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-02-25 19:31:41 -08:00
apostasie 9210685ba0
Makefile cleanup
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-02-25 18:51:18 -08:00
Kohei Tokunaga c12aaa3399
Merge pull request #3930 from AkihiroSuda/gha-arm
CI: arm64-8core-32gb -> ubuntu-24.04-arm
2025-02-26 11:31:10 +09:00
Kohei Tokunaga 90971d3ead
Merge pull request #3925 from AkihiroSuda/go1.24
update Go (1.24)
2025-02-26 11:28:31 +09:00
Akihiro Suda 7f7204ac6b
Merge pull request #3913 from apostasie/refactor-cmd-1
Refactor: suggesting we normalize all command variables to cmd
2025-02-26 11:04:37 +09:00
Akihiro Suda 5f1137185d
Merge pull request #3911 from apostasie/ci-import-reviser
CI: goimports-reviser: remove hack
2025-02-26 11:02:52 +09:00
Akihiro Suda 3a99ed8250
Merge pull request #3920 from apostasie/fix-3866
Fix: restrict EnsureContent to the requested platform
2025-02-26 11:02:38 +09:00
apostasie b41e8c9885
Normalize all command variables to cmd
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-02-25 17:08:21 -08:00
apostasie 701e556316
goimports-reviser: remove hack
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-02-25 17:01:52 -08:00
apostasie 7fcde18b16
Disable golangci preflight config validation
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-02-25 17:01:13 -08:00
Akihiro Suda 11f6fe2c8b
go.mod: set minimum Go version to 1.23
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2025-02-26 08:59:18 +09:00
Akihiro Suda 7341e8414a
CI: set GOTOOLCHAIN=local
So that we can specify the Go version deterministically

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2025-02-26 08:59:18 +09:00
Akihiro Suda 18df140288
update Go (1.24)
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2025-02-26 08:59:18 +09:00
Akihiro Suda cd15112788
CI: arm64-8core-32gb -> ubuntu-24.04-arm
GHA now provides ARM runners for free

https://github.blog/changelog/2025-01-16-linux-arm64-hosted-runners-now-available-for-free-in-public-repositories-public-preview/

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2025-02-26 08:55:13 +09:00
Akihiro Suda c2b949f45e
Merge pull request #3931 from apostasie/ci-timeout
Increase CI run timeout
2025-02-26 06:43:29 +09:00
apostasie 01d3cafbd9
Increase CI run timeout
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-02-25 08:46:49 -08:00
apostasie 0d62b98e2d
Restrict EnsureContent to the requested platform
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-02-25 08:34:42 -08:00
fahed dorgaa 5be956c2e7
Merge pull request #3929 from AkihiroSuda/fail-fast-false
CI: set fail-fast to false
2025-02-25 16:39:35 +01:00
Akihiro Suda 70440e53ea
Merge pull request #3923 from containerd/dependabot/go_modules/github.com/go-jose/go-jose/v4-4.0.5
build(deps): bump github.com/go-jose/go-jose/v4 from 4.0.4 to 4.0.5
2025-02-25 20:39:22 +09:00
Akihiro Suda fc255164f4
Merge pull request #3918 from apostasie/ci-fix-flaky-signals
CI: rewrite signal tests
2025-02-25 19:57:20 +09:00
Akihiro Suda 745aaf7faa
CI: set fail-fast to false
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2025-02-25 19:38:11 +09:00
dependabot[bot] 10ddc598c3
build(deps): bump github.com/go-jose/go-jose/v4 from 4.0.4 to 4.0.5
Bumps [github.com/go-jose/go-jose/v4](https://github.com/go-jose/go-jose) from 4.0.4 to 4.0.5.
- [Release notes](https://github.com/go-jose/go-jose/releases)
- [Changelog](https://github.com/go-jose/go-jose/blob/main/CHANGELOG.md)
- [Commits](https://github.com/go-jose/go-jose/compare/v4.0.4...v4.0.5)

---
updated-dependencies:
- dependency-name: github.com/go-jose/go-jose/v4
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-02-24 22:52:51 +00:00
Arjun Raja Yogidas 37d9958776 feat: add hostConfig to nerdctl inspect response
This commit adds the following fields to the hostconfig struct that is
retured when container inspect is called.
- CIdFile
- GroupAdd
- Memory
- CgroupNsMode
- DNS config
- OOMScoreAdj
- ReadonlyRootfs
- UTSMode
- ShmSize
- Runtime
- Sysctl
- Device
- PidMode

Signed-off-by: Arjun Raja Yogidas <arjunry@amazon.com>
2025-02-24 18:07:19 +00:00
apostasie c2c1d4a064
Rewrite signal tests
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-02-24 09:21:35 -08:00
apostasie d90729c8b6
Add test tooling for signals
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-02-24 09:21:34 -08:00
Akihiro Suda 6f608da541
Merge pull request #3889 from apostasie/sub-project-testing
CI: make the `test` framework usable standalone in other projects
2025-02-25 00:40:10 +09:00
Akihiro Suda c01d0fa574
Merge pull request #3912 from apostasie/fix-3907
[PRIORITY] fix: prevent acquire from blanking out hosts file
2025-02-24 17:02:46 +09:00
Akihiro Suda 1d4cdfa6df
Merge pull request #3919 from apostasie/ci-unbuffer-redux
CI: remove unbuffer from container tests
2025-02-24 17:02:20 +09:00
apostasie 16e22577d7
Make subpackage test a separate module
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-02-23 23:03:41 -08:00
apostasie 655171c78c
Remove unbuffer from container tests
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-02-23 17:53:59 -08:00
Akihiro Suda 46be3a7cad
Merge pull request #3850 from apostasie/cleanup-xdg
Cleanup XDGRuntime
2025-02-23 10:28:40 +09:00
Akihiro Suda f553ab2a38
Merge pull request #3909 from apostasie/docker-deprecation
Remove transient sysinfo package now that moby has moved away from containerd v1
2025-02-23 10:28:19 +09:00
apostasie c7919f93d1
Prevent acquire from blanking hosts file
See https://github.com/containerd/nerdctl/issues/3907

Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-02-21 23:39:09 -08:00
Akihiro Suda 4beadf140a
Merge pull request #3591 from apostasie/series-4
Add support for writing to ptys
2025-02-22 13:29:37 +09:00
apostasie 3b59119e4b
Cleanup XDGRuntime logic
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-02-21 20:29:26 -08:00
apostasie 0128d4a826
Remove forked sysinfo package
During the migration to containerd v2, we forked sysinfo as docker was still depending
on containerd v1 at that time.
With their latest 28 release, docker has now moved on, and we can get rid of the fork.
There is a few minor changes required to make it work:
- move to runtime.NumCPU as the sysinfo indirection has been removed
- remove use of deprecated fields

Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-02-21 13:55:15 -08:00
apostasie 11e6d04b93
Tests to error on timeout
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-02-21 09:57:05 -08:00
apostasie a687e2c91c
Rewrite detach tests without unbuffer
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-02-21 09:57:00 -08:00
Akihiro Suda 66a7a75e61
Merge pull request #3898 from coderbirju/add-signal-container-restart
feat: add signal option to containerRestart
2025-02-21 17:29:26 +09:00
Arjun Raja Yogidas 8664311cad feat: add signal option to containerRestart
Signed-off-by: Arjun Raja Yogidas <arjunry@amazon.com>
2025-02-20 21:16:11 +00:00
fahed dorgaa 8b44f5454b
Merge pull request #3900 from containerd/dependabot/github_actions/docker/build-push-action-6.14.0
build(deps): bump docker/build-push-action from 6.13.0 to 6.14.0
2025-02-20 14:16:49 +01:00
fahed dorgaa 2215dc5d15
Merge pull request #3903 from dancavallaro/dancavallaro/propagation
Support bind propagation options in Compose volume long syntax
2025-02-20 11:40:41 +01:00
Akihiro Suda 98f3846810
Merge pull request #3905 from trinidadgithub/docs/add-log-driver-none
docs: add --log-driver=none to run command reference
2025-02-20 18:47:48 +09:00
Trinidad Marroquin Jr. 8bef3618aa docs: add --log-driver=none to run command reference
Closes #3755

Signed-off-by: Trinidad Marroquin Jr. <trinidad.marroquin@gmail.com>
2025-02-20 02:56:07 -06:00
Akihiro Suda 856bb40ebe
Merge pull request #3899 from containerd/dependabot/github_actions/actions/cache-4.2.1
build(deps): bump actions/cache from 4.2.0 to 4.2.1
2025-02-20 12:38:41 +09:00
Akihiro Suda c7b9f56240
Merge pull request #3902 from containerd/dependabot/go_modules/github.com/containerd/accelerated-container-image-1.3.0
build(deps): bump github.com/containerd/accelerated-container-image from 1.2.3 to 1.3.0
2025-02-20 12:38:19 +09:00
Dan Cavallaro c169499893 Support bind propagation options in Compose volume long syntax
Signed-off-by: Dan Cavallaro <dan.t.cavallaro@gmail.com>
2025-02-19 22:05:17 -05:00
Akihiro Suda 26c7b26d84
Merge pull request #3901 from containerd/dependabot/go_modules/github.com/klauspost/compress-1.18.0
build(deps): bump github.com/klauspost/compress from 1.17.11 to 1.18.0
2025-02-20 10:34:40 +09:00
dependabot[bot] 4e0688b760
build(deps): bump github.com/containerd/accelerated-container-image
Bumps [github.com/containerd/accelerated-container-image](https://github.com/containerd/accelerated-container-image) from 1.2.3 to 1.3.0.
- [Release notes](https://github.com/containerd/accelerated-container-image/releases)
- [Commits](https://github.com/containerd/accelerated-container-image/compare/v1.2.3...v1.3.0)

---
updated-dependencies:
- dependency-name: github.com/containerd/accelerated-container-image
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-02-19 22:57:42 +00:00
dependabot[bot] a0f1236996
build(deps): bump github.com/klauspost/compress from 1.17.11 to 1.18.0
Bumps [github.com/klauspost/compress](https://github.com/klauspost/compress) from 1.17.11 to 1.18.0.
- [Release notes](https://github.com/klauspost/compress/releases)
- [Changelog](https://github.com/klauspost/compress/blob/master/.goreleaser.yml)
- [Commits](https://github.com/klauspost/compress/compare/v1.17.11...v1.18.0)

---
updated-dependencies:
- dependency-name: github.com/klauspost/compress
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-02-19 22:57:30 +00:00
dependabot[bot] 59b48e6318
build(deps): bump docker/build-push-action from 6.13.0 to 6.14.0
Bumps [docker/build-push-action](https://github.com/docker/build-push-action) from 6.13.0 to 6.14.0.
- [Release notes](https://github.com/docker/build-push-action/releases)
- [Commits](ca877d9245...0adf995921)

---
updated-dependencies:
- dependency-name: docker/build-push-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-02-19 22:12:16 +00:00
dependabot[bot] 3eb9a963d7
build(deps): bump actions/cache from 4.2.0 to 4.2.1
Bumps [actions/cache](https://github.com/actions/cache) from 4.2.0 to 4.2.1.
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](1bd1e32a3b...0c907a75c2)

---
updated-dependencies:
- dependency-name: actions/cache
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-02-19 22:12:14 +00:00
Jin Dong 89003a5883
Merge pull request #3892 from coderbirju/add-signal-container-stop
add signal option to container stop command
2025-02-18 17:59:40 -05:00
Arjun Raja Yogidas d3f5d1053e add tests
Signed-off-by: Arjun Raja Yogidas <arjunry@amazon.com>
2025-02-18 18:07:43 +00:00
Akihiro Suda 87cc0748d3
Merge pull request #3885 from swagatbora90/add-domainname-option
feat: add support for 'domainname' option in container create
2025-02-18 15:55:20 +09:00
Jin Dong fd53b80a1a
Merge pull request #3894 from containerd/dependabot/go_modules/github.com/spf13/cobra-1.9.1
build(deps): bump github.com/spf13/cobra from 1.8.1 to 1.9.1
2025-02-17 18:41:00 -05:00
Jin Dong 1370ef8c7e
Merge pull request #3893 from containerd/dependabot/github_actions/golangci/golangci-lint-action-6.5.0
build(deps): bump golangci/golangci-lint-action from 6.4.1 to 6.5.0
2025-02-17 18:40:18 -05:00
dependabot[bot] b45d96db29
build(deps): bump github.com/spf13/cobra from 1.8.1 to 1.9.1
Bumps [github.com/spf13/cobra](https://github.com/spf13/cobra) from 1.8.1 to 1.9.1.
- [Release notes](https://github.com/spf13/cobra/releases)
- [Commits](https://github.com/spf13/cobra/compare/v1.8.1...v1.9.1)

---
updated-dependencies:
- dependency-name: github.com/spf13/cobra
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-02-17 22:09:46 +00:00
dependabot[bot] 31a7ab84be
build(deps): bump golangci/golangci-lint-action from 6.4.1 to 6.5.0
Bumps [golangci/golangci-lint-action](https://github.com/golangci/golangci-lint-action) from 6.4.1 to 6.5.0.
- [Release notes](https://github.com/golangci/golangci-lint-action/releases)
- [Commits](818ec4d51a...2226d7cb06)

---
updated-dependencies:
- dependency-name: golangci/golangci-lint-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-02-17 22:02:14 +00:00
fahed dorgaa 67ecd67329
Merge pull request #3888 from weiyuhang2011/fix-3876
Fix FATA error when inspecting images in native mode
2025-02-17 12:02:57 +01:00
Arjun Raja Yogidas 99210b6905 add signal option to container stop command
Signed-off-by: Arjun Raja Yogidas <arjunry@amazon.com>
2025-02-17 05:30:14 +00:00
Swagat Bora 893a393702 feat: add support for 'domainname' option in container create
Signed-off-by: Swagat Bora <sbora@amazon.com>
2025-02-16 20:08:13 +00:00
Jin Dong a1a2ec265a
Merge pull request #3884 from austinvazquez/update-nerdctl-1.2.5
update runc (1.2.5)
2025-02-15 13:42:22 -08:00
Yuhang Wei 5ffcba6e6f Fix FATA error when inspecting images in native mode
Signed-off-by: Yuhang Wei <weiyuhang2011@gmail.com>
2025-02-15 21:32:05 +08:00
Akihiro Suda 8bd86998d1
Merge pull request #3443 from Shubhranshu153/fix-network-none
Enable other containers to join network namespace of the none network
2025-02-15 21:25:11 +09:00
Akihiro Suda 369e7e7257
Merge pull request #3880 from Shubhranshu153/fix-network-cleanup
fix: network cleanup called twice
2025-02-15 17:28:00 +09:00
Akihiro Suda 0b7d11923a
Merge pull request #3887 from apostasie/ci-minor-cleanup
Ci minor cleanup
2025-02-15 17:27:41 +09:00
Akihiro Suda 0e6c2e9b49
Merge pull request #3886 from containerd/dependabot/github_actions/golangci/golangci-lint-action-6.4.1
build(deps): bump golangci/golangci-lint-action from 6.3.2 to 6.4.1
2025-02-15 17:26:22 +09:00
Akihiro Suda 1995b11e33
Merge pull request #3879 from subashkotha/update-nerdctl-compose-readme
docs(nerdctl-compose): add missing details in command-reference.md
2025-02-15 17:26:04 +09:00
apostasie 3f496b8c92
Cleanup old/unused helpers
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-02-14 17:07:33 -08:00
apostasie 105e5eba3f
Remove require daemon version for >=1.6
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-02-14 17:04:29 -08:00
dependabot[bot] 8675cc6ce9
build(deps): bump golangci/golangci-lint-action from 6.3.2 to 6.4.1
Bumps [golangci/golangci-lint-action](https://github.com/golangci/golangci-lint-action) from 6.3.2 to 6.4.1.
- [Release notes](https://github.com/golangci/golangci-lint-action/releases)
- [Commits](051d919338...818ec4d51a)

---
updated-dependencies:
- dependency-name: golangci/golangci-lint-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-02-14 23:00:28 +00:00
apostasie cb4163192a
Add pty support for testing
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-02-14 13:52:42 -08:00
Austin Vazquez 94c271e80c
update runc (1.2.5)
Signed-off-by: Austin Vazquez <macedonv@amazon.com>
2025-02-14 03:41:49 +00:00
Shubharanshu Mahapatra 974bc8431c fix: network cleanup called twice
Signed-off-by: Shubharanshu Mahapatra <shubhum@amazon.com>
2025-02-13 16:40:34 +05:30
Subash Kotha 4e111d329c docs(nerdctl-compose): add missing details in command-reference.md
Signed-off-by: Subash Kotha <subash.kotha2@gmail.com>
2025-02-12 14:54:49 -08:00
Jin Dong 8e9e464a50
Merge pull request #3873 from containerd/dependabot/go_modules/golang-x-4d974c417d
build(deps): bump golang.org/x/net from 0.34.0 to 0.35.0 in the golang-x group
2025-02-10 16:41:20 -08:00
Jin Dong 4051b7867f
Merge pull request #3872 from containerd/dependabot/github_actions/golangci/golangci-lint-action-6.3.2
build(deps): bump golangci/golangci-lint-action from 6.3.0 to 6.3.2
2025-02-10 15:59:17 -08:00
Jin Dong 60c2356f2f
Merge pull request #3874 from containerd/dependabot/go_modules/gotest.tools/v3-3.5.2
build(deps): bump gotest.tools/v3 from 3.5.1 to 3.5.2
2025-02-10 15:58:34 -08:00
Jin Dong 04c3508cbb
Merge pull request #3875 from containerd/dependabot/go_modules/github.com/compose-spec/compose-go/v2-2.4.8
build(deps): bump github.com/compose-spec/compose-go/v2 from 2.4.7 to 2.4.8
2025-02-10 15:57:33 -08:00
dependabot[bot] 4722dd6fbe
build(deps): bump github.com/compose-spec/compose-go/v2
Bumps [github.com/compose-spec/compose-go/v2](https://github.com/compose-spec/compose-go) from 2.4.7 to 2.4.8.
- [Release notes](https://github.com/compose-spec/compose-go/releases)
- [Commits](https://github.com/compose-spec/compose-go/compare/v2.4.7...v2.4.8)

---
updated-dependencies:
- dependency-name: github.com/compose-spec/compose-go/v2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-02-10 22:40:01 +00:00
dependabot[bot] 3680b00aab
build(deps): bump gotest.tools/v3 from 3.5.1 to 3.5.2
Bumps [gotest.tools/v3](https://github.com/gotestyourself/gotest.tools) from 3.5.1 to 3.5.2.
- [Release notes](https://github.com/gotestyourself/gotest.tools/releases)
- [Commits](https://github.com/gotestyourself/gotest.tools/compare/v3.5.1...v3.5.2)

---
updated-dependencies:
- dependency-name: gotest.tools/v3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-02-10 22:39:54 +00:00
dependabot[bot] 3f7b70faf0
build(deps): bump golang.org/x/net in the golang-x group
Bumps the golang-x group with 1 update: [golang.org/x/net](https://github.com/golang/net).


Updates `golang.org/x/net` from 0.34.0 to 0.35.0
- [Commits](https://github.com/golang/net/compare/v0.34.0...v0.35.0)

---
updated-dependencies:
- dependency-name: golang.org/x/net
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: golang-x
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-02-10 22:39:45 +00:00
dependabot[bot] a6086d1ebb
build(deps): bump golangci/golangci-lint-action from 6.3.0 to 6.3.2
Bumps [golangci/golangci-lint-action](https://github.com/golangci/golangci-lint-action) from 6.3.0 to 6.3.2.
- [Release notes](https://github.com/golangci/golangci-lint-action/releases)
- [Commits](e60da84bfa...051d919338)

---
updated-dependencies:
- dependency-name: golangci/golangci-lint-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-02-10 22:27:31 +00:00
Shubharanshu Mahapatra d64ab5a9ca enable host name and default resolv.conf and hosts file in none network
Signed-off-by: Shubharanshu Mahapatra <shubhum@amazon.com>
2025-02-10 02:01:25 +05:30
Akihiro Suda cb915f6539
Merge pull request #3868 from containerd/dependabot/github_actions/docker/setup-qemu-action-3.4.0
build(deps): bump docker/setup-qemu-action from 3.3.0 to 3.4.0
2025-02-09 15:36:36 +09:00
dependabot[bot] 402bd2a28f
build(deps): bump docker/setup-qemu-action from 3.3.0 to 3.4.0
Bumps [docker/setup-qemu-action](https://github.com/docker/setup-qemu-action) from 3.3.0 to 3.4.0.
- [Release notes](https://github.com/docker/setup-qemu-action/releases)
- [Commits](53851d1459...4574d27a47)

---
updated-dependencies:
- dependency-name: docker/setup-qemu-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-02-08 06:03:31 +00:00
Jin Dong d5c26ef62a
Merge pull request #3869 from containerd/dependabot/github_actions/docker/setup-buildx-action-3.9.0
build(deps): bump docker/setup-buildx-action from 3.8.0 to 3.9.0
2025-02-07 22:02:37 -08:00
Jin Dong 0bf2b22338
Merge pull request #3871 from containerd/dependabot/go_modules/golang-x-0f02c582b3
build(deps): bump golang.org/x/crypto from 0.32.0 to 0.33.0 in the golang-x group
2025-02-07 18:24:48 -08:00
dependabot[bot] 0f17259a77
build(deps): bump golang.org/x/crypto in the golang-x group
Bumps the golang-x group with 1 update: [golang.org/x/crypto](https://github.com/golang/crypto).


Updates `golang.org/x/crypto` from 0.32.0 to 0.33.0
- [Commits](https://github.com/golang/crypto/compare/v0.32.0...v0.33.0)

---
updated-dependencies:
- dependency-name: golang.org/x/crypto
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: golang-x
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-02-07 22:26:30 +00:00
Akihiro Suda 9fcd7eeb0e
Merge pull request #3870 from yankay/fix-nerdctl-full-SHA256SUMS
Fix nerdctl-full shasum fails by move the sha256sum to build-full stage
2025-02-07 16:28:35 +09:00
Akihiro Suda 73a4b01cfc
Merge pull request #3865 from fengwei0328/permission
Reduce file permissions
2025-02-07 16:06:34 +09:00
Kay Yan c6666e3fe4
fix nerdctl-full SHA256SUMS fails
Signed-off-by: Kay Yan <kay.yan@daocloud.io>
2025-02-07 04:05:43 +00:00
fengwei0328 cf95ae0eac Reduce file permissions
Signed-off-by: fengwei0328 <feng.wei8@zte.com.cn>
2025-02-07 11:40:21 +08:00
dependabot[bot] c4a795fa57
build(deps): bump docker/setup-buildx-action from 3.8.0 to 3.9.0
Bumps [docker/setup-buildx-action](https://github.com/docker/setup-buildx-action) from 3.8.0 to 3.9.0.
- [Release notes](https://github.com/docker/setup-buildx-action/releases)
- [Commits](6524bf65af...f7ce87c1d6)

---
updated-dependencies:
- dependency-name: docker/setup-buildx-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-02-06 22:58:17 +00:00
Jin Dong 21590cd689
Merge pull request #3864 from containerd/dependabot/github_actions/golangci/golangci-lint-action-6.3.0
build(deps): bump golangci/golangci-lint-action from 6.2.0 to 6.3.0
2025-02-05 16:20:21 -05:00
Akihiro Suda 4a8d9937d7
Merge pull request #3863 from containerd/dependabot/go_modules/golang-x-ce1862f233
build(deps): bump the golang-x group with 4 updates
2025-02-05 08:28:03 +09:00
Akihiro Suda b59828a22b
Merge pull request #3843 from apostasie/fix-3839
Harden journald test
2025-02-05 08:27:40 +09:00
dependabot[bot] 5e36bef0eb
build(deps): bump golangci/golangci-lint-action from 6.2.0 to 6.3.0
Bumps [golangci/golangci-lint-action](https://github.com/golangci/golangci-lint-action) from 6.2.0 to 6.3.0.
- [Release notes](https://github.com/golangci/golangci-lint-action/releases)
- [Commits](ec5d18412c...e60da84bfa)

---
updated-dependencies:
- dependency-name: golangci/golangci-lint-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-02-04 22:48:08 +00:00
dependabot[bot] fd0bcbe5f8
build(deps): bump the golang-x group with 4 updates
Bumps the golang-x group with 4 updates: [golang.org/x/sync](https://github.com/golang/sync), [golang.org/x/sys](https://github.com/golang/sys), [golang.org/x/term](https://github.com/golang/term) and [golang.org/x/text](https://github.com/golang/text).


Updates `golang.org/x/sync` from 0.10.0 to 0.11.0
- [Commits](https://github.com/golang/sync/compare/v0.10.0...v0.11.0)

Updates `golang.org/x/sys` from 0.29.0 to 0.30.0
- [Commits](https://github.com/golang/sys/compare/v0.29.0...v0.30.0)

Updates `golang.org/x/term` from 0.28.0 to 0.29.0
- [Commits](https://github.com/golang/term/compare/v0.28.0...v0.29.0)

Updates `golang.org/x/text` from 0.21.0 to 0.22.0
- [Release notes](https://github.com/golang/text/releases)
- [Commits](https://github.com/golang/text/compare/v0.21.0...v0.22.0)

---
updated-dependencies:
- dependency-name: golang.org/x/sync
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: golang-x
- dependency-name: golang.org/x/sys
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: golang-x
- dependency-name: golang.org/x/term
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: golang-x
- dependency-name: golang.org/x/text
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: golang-x
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-02-04 22:36:54 +00:00
fahed dorgaa a457d9c157
Merge pull request #3860 from apostasie/fix-3859
Fix apparmor test not running
2025-02-03 11:02:16 +01:00
fahed dorgaa 0f9f0629eb
Merge pull request #3853 from apostasie/fix-3852
Prevent reference filter from failing on dangling images
2025-02-03 11:00:47 +01:00
apostasie 2ecc394456
Fix apparmor test not running
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-02-02 13:42:15 -08:00
apostasie 3863614514
Prevent reference filter from failing on dangling images
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-02-02 13:39:17 -08:00
Jin Dong 8ef14b7a27
Merge pull request #3857 from containerd/dependabot/go_modules/github.com/spf13/pflag-1.0.6
build(deps): bump github.com/spf13/pflag from 1.0.5 to 1.0.6
2025-01-30 22:34:24 -05:00
dependabot[bot] 2b07c18853
build(deps): bump github.com/spf13/pflag from 1.0.5 to 1.0.6
Bumps [github.com/spf13/pflag](https://github.com/spf13/pflag) from 1.0.5 to 1.0.6.
- [Release notes](https://github.com/spf13/pflag/releases)
- [Commits](https://github.com/spf13/pflag/compare/v1.0.5...v1.0.6)

---
updated-dependencies:
- dependency-name: github.com/spf13/pflag
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-01-29 22:35:12 +00:00
apostasie 8a80469c26
Harden journald test
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-01-29 14:00:11 -08:00
Akihiro Suda 89214a42d4
Merge pull request #3837 from apostasie/ci-3404
Skip TestRunBindMountPropagation
2025-01-29 16:49:37 +09:00
Akihiro Suda e5a7bc3d51
Merge pull request #3841 from apostasie/fix-3840
Fix journald logger exit and wait behavior
2025-01-29 13:45:07 +09:00
Akihiro Suda 67a1088af3
Merge pull request #3832 from apostasie/fix-3765-follow-up
3771 follow up: use %w consistently when wrapping errors
2025-01-29 13:05:32 +09:00
Akihiro Suda bf46306efc
Merge pull request #3855 from containerd/dependabot/go_modules/github.com/cyphar/filepath-securejoin-0.4.1
build(deps): bump github.com/cyphar/filepath-securejoin from 0.4.0 to 0.4.1
2025-01-29 09:22:24 +09:00
dependabot[bot] 7565cebb5b
build(deps): bump github.com/cyphar/filepath-securejoin
Bumps [github.com/cyphar/filepath-securejoin](https://github.com/cyphar/filepath-securejoin) from 0.4.0 to 0.4.1.
- [Release notes](https://github.com/cyphar/filepath-securejoin/releases)
- [Changelog](https://github.com/cyphar/filepath-securejoin/blob/main/CHANGELOG.md)
- [Commits](https://github.com/cyphar/filepath-securejoin/compare/v0.4.0...v0.4.1)

---
updated-dependencies:
- dependency-name: github.com/cyphar/filepath-securejoin
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-01-28 22:36:56 +00:00
fahed dorgaa 528b8529ab
Merge pull request #3846 from apostasie/fix-broken-systemd-test
Disable systemd test on arm64
2025-01-28 21:58:14 +01:00
Jin Dong c69f816563
Merge pull request #3831 from haytok/nerdctl_issue_3539
Fix port forwarding not working for non-127.0.0.1 localhost in rootless
2025-01-28 14:17:23 -05:00
Hayato Kiwata 653c6de0da test: Add a test for container access with 127.0.0.2 specified in -p in rootless mode
When running a rootless container, specifying an address such as 127.0.0.2
for the -p option, we will not be able to access the published container
through that address.

This behavior is reported in the following issue:

- https://github.com/containerd/nerdctl/issues/3539

This behavior is caused by the behavior in rootlesskit, and the following
pull request has been made to improve the behavior.

- https://github.com/rootless-containers/rootlesskit/pull/477

Therefore, this commit adds a test to ensure that the behavior of the
issue has been improved.

Signed-off-by: Hayato Kiwata <haytok@amazon.co.jp>
2025-01-28 14:44:42 +00:00
apostasie 82791bf62c
fix journald logger exit and wait behavior
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-01-27 19:37:17 -08:00
Jin Dong a178c2933e
Merge pull request #3849 from apostasie/fix-3848
Fix socket address not being updated properly
2025-01-27 09:03:47 -05:00
apostasie 2a750939d3
Consistently use WithError when logging errors instead of %s
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-01-26 23:40:18 -08:00
apostasie 17bbdffd86
Consistently use %w instead of %s or %v when wrapping errors
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-01-26 23:40:17 -08:00
Akihiro Suda f8e47e8640
Merge pull request #3836 from apostasie/fix-idiot
Fix wrong error comparison
2025-01-27 15:39:58 +09:00
Akihiro Suda 01c15a743f
Merge pull request #3771 from apostasie/fix-3765
Relax error on network annotation read failure
2025-01-27 15:39:00 +09:00
Akihiro Suda c890dd6921
Merge pull request #3842 from apostasie/ci-utc-fix
Fix test time to use UTC
2025-01-27 15:38:04 +09:00
fahed dorgaa 1e8f43bedc
Merge pull request #3835 from SpiffyEight77/fix/issue-3755
fix: prevent panic in nydus snapshotter inspect
2025-01-26 10:08:16 +01:00
fahed dorgaa 338219478d
Merge pull request #3847 from apostasie/ci-fix-tini-custom
Test portability fix: ensure tini-custom is here
2025-01-26 10:06:22 +01:00
Ruihua Wen 6e5e943bd3
fix: prevent panic in nydus snapshotter inspect
Signed-off-by: Ruihua Wen <spiffyeight77@gmail.com>
2025-01-26 00:32:05 +09:00
fahed dorgaa d88bed434a
Merge pull request #3844 from containerd/dependabot/github_actions/docker/build-push-action-6.13.0
build(deps): bump docker/build-push-action from 6.12.0 to 6.13.0
2025-01-25 12:58:28 +01:00
apostasie 7f433aaa6f
Fix socket address not being updated properly
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-01-24 17:14:55 -08:00
apostasie 10e4cda35b
Test portability fix: ensure tini-custom is here
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-01-24 15:14:40 -08:00
apostasie 7c9d25adc1
Disable systemd test on arm64
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-01-24 14:40:56 -08:00
dependabot[bot] fe59974dcb
build(deps): bump docker/build-push-action from 6.12.0 to 6.13.0
Bumps [docker/build-push-action](https://github.com/docker/build-push-action) from 6.12.0 to 6.13.0.
- [Release notes](https://github.com/docker/build-push-action/releases)
- [Commits](67a2d409c0...ca877d9245)

---
updated-dependencies:
- dependency-name: docker/build-push-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-01-24 22:03:44 +00:00
apostasie 99bd772884
Fix test time to use UTC
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-01-24 00:54:36 -08:00
apostasie 735203367a
Skip TestRunBindMountPropagation
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-01-23 22:56:45 -08:00
apostasie a6fe6c1555
Fix wrong error comparison
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-01-23 18:29:14 -08:00
apostasie ec6a6abd71
Relax error on annotations read failure
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2025-01-23 13:41:33 -08:00
Jin Dong 300a705e8b
Merge pull request #3829 from containerd/dependabot/github_actions/actions/setup-go-5.3.0
build(deps): bump actions/setup-go from 5.2.0 to 5.3.0
2025-01-22 20:56:11 -05:00
Jin Dong fc59620ed7
Merge pull request #3834 from containerd/dependabot/go_modules/github.com/ipfs/go-cid-0.5.0
build(deps): bump github.com/ipfs/go-cid from 0.4.1 to 0.5.0
2025-01-22 20:55:53 -05:00
Jin Dong 1e83a48355
Merge pull request #3833 from containerd/dependabot/go_modules/docker-89c4bf0385
build(deps): bump the docker group with 2 updates
2025-01-22 19:06:28 -05:00
dependabot[bot] 26c03224a0
build(deps): bump github.com/ipfs/go-cid from 0.4.1 to 0.5.0
Bumps [github.com/ipfs/go-cid](https://github.com/ipfs/go-cid) from 0.4.1 to 0.5.0.
- [Release notes](https://github.com/ipfs/go-cid/releases)
- [Commits](https://github.com/ipfs/go-cid/compare/v0.4.1...v0.5.0)

---
updated-dependencies:
- dependency-name: github.com/ipfs/go-cid
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-01-22 23:00:00 +00:00
dependabot[bot] 8a0c16c08c
build(deps): bump the docker group with 2 updates
Bumps the docker group with 2 updates: [github.com/docker/cli](https://github.com/docker/cli) and [github.com/docker/docker](https://github.com/docker/docker).


Updates `github.com/docker/cli` from 27.5.0+incompatible to 27.5.1+incompatible
- [Commits](https://github.com/docker/cli/compare/v27.5.0...v27.5.1)

Updates `github.com/docker/docker` from 27.5.0+incompatible to 27.5.1+incompatible
- [Release notes](https://github.com/docker/docker/releases)
- [Commits](https://github.com/docker/docker/compare/v27.5.0...v27.5.1)

---
updated-dependencies:
- dependency-name: github.com/docker/cli
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: docker
- dependency-name: github.com/docker/docker
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: docker
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-01-22 22:59:46 +00:00
Akihiro Suda 558dd93c71
Merge pull request #3830 from containerd/dependabot/go_modules/github.com/rootless-containers/bypass4netns-0.4.2
build(deps): bump github.com/rootless-containers/bypass4netns from 0.4.1 to 0.4.2
2025-01-22 10:23:40 +09:00
dependabot[bot] af3bb9995a
build(deps): bump github.com/rootless-containers/bypass4netns
Bumps [github.com/rootless-containers/bypass4netns](https://github.com/rootless-containers/bypass4netns) from 0.4.1 to 0.4.2.
- [Commits](https://github.com/rootless-containers/bypass4netns/compare/v0.4.1...v0.4.2)

---
updated-dependencies:
- dependency-name: github.com/rootless-containers/bypass4netns
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-01-21 22:54:27 +00:00
dependabot[bot] 84caccfcbb
build(deps): bump actions/setup-go from 5.2.0 to 5.3.0
Bumps [actions/setup-go](https://github.com/actions/setup-go) from 5.2.0 to 5.3.0.
- [Release notes](https://github.com/actions/setup-go/releases)
- [Commits](3041bf56c9...f111f3307d)

---
updated-dependencies:
- dependency-name: actions/setup-go
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-01-21 22:11:50 +00:00
Akihiro Suda 8b92434233
Merge pull request #3828 from ktock/carry-3827
[Carry 3827] update Kubo (0.32.1)
2025-01-21 18:29:06 +09:00
Kohei Tokunaga a4fa4faafd
integration test: specify IPFS_PATH for IPFS service
Signed-off-by: Kohei Tokunaga <ktokunaga.mail@gmail.com>
2025-01-21 16:34:34 +09:00
Kohei Tokunaga ce61fc4034
Merge pull request #3826 from AkihiroSuda/dev
update containerd (2.0.2), RootlessKit (2.3.2), bypass4netns (0.4.2), containerd-fuse-overlayfs (2.1.1), BuildKit (0.19.0)
2025-01-21 15:35:24 +09:00
Akihiro Suda cb7fc0d4be
update BuildKit (0.19.0)
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2025-01-21 10:10:27 +09:00
Akihiro Suda e7e27f6266
update containerd-fuse-overlayfs (2.1.1)
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2025-01-21 10:10:27 +09:00
Akihiro Suda 00e21f75b4
update bypass4netns (0.4.2)
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2025-01-21 10:10:27 +09:00
Akihiro Suda d786133a08
update RootlessKit (2.3.2)
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2025-01-21 10:10:24 +09:00
Akihiro Suda f17df13e38
update Kubo (0.32.1)
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2025-01-21 09:59:43 +09:00
Akihiro Suda 8af25af64f
update containerd (2.0.2)
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2025-01-21 09:52:07 +09:00
Akihiro Suda 587ae99edf
Merge pull request #3825 from containerd/dependabot/go_modules/github.com/rootless-containers/rootlesskit/v2-2.3.2
build(deps): bump github.com/rootless-containers/rootlesskit/v2 from 2.3.1 to 2.3.2
2025-01-21 09:47:56 +09:00
dependabot[bot] 08206c8e2e
build(deps): bump github.com/rootless-containers/rootlesskit/v2
Bumps [github.com/rootless-containers/rootlesskit/v2](https://github.com/rootless-containers/rootlesskit) from 2.3.1 to 2.3.2.
- [Release notes](https://github.com/rootless-containers/rootlesskit/releases)
- [Commits](https://github.com/rootless-containers/rootlesskit/compare/v2.3.1...v2.3.2)

---
updated-dependencies:
- dependency-name: github.com/rootless-containers/rootlesskit/v2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-01-20 22:16:10 +00:00
Akihiro Suda 2eeb8de113
Merge pull request #3818 from zzzzzzzzzy9/update
reset spec if update returned error
2025-01-20 11:34:07 +09:00
fahed dorgaa b792f1f580
Merge pull request #3822 from haytok/nerdctl_issue_3806
fix: save multiple images for the same image id to a tar archive
2025-01-19 23:09:17 +01:00
fahed dorgaa 343a122cf9
Merge pull request #3821 from containerd/dependabot/github_actions/docker/build-push-action-6.12.0
build(deps): bump docker/build-push-action from 6.11.0 to 6.12.0
2025-01-19 14:57:28 +01:00
Akihiro Suda 9a1d57b743
Merge pull request #3820 from fahedouch/reflect-apparmor-restrict-unprivileged-userns
[doc] Add AppArmor profile setup for rootlesskit on Ubuntu 24.04+
2025-01-19 21:57:36 +09:00
fahed dorgaa 128e6a7cd7
[doc] AppArmor profile setup for rootlesskit
Introduce documentation for AppArmor profile for rootlesskit.

Signed-off-by: fahed dorgaa <fahed.dorgaa@gmail.com>
2025-01-19 13:54:01 +01:00
Akihiro Suda 5fdd049476
Merge pull request #3824 from rerpha/patch-1
Correct `compose logs` command reference
2025-01-18 05:34:46 +09:00
Jack Harper ab027adfab
Correct `compose logs` command reference
Signed-off-by: Jack Harper <harps912@gmail.com>
2025-01-17 16:08:59 +00:00
Hayato Kiwata 9a6426d86c fix: save multiple images for the same image id to a tar archive
Suppose we try to save multiple container images with the same image ID
but different image names into a tar archive using the nerdctl save
command.

When we then try to load container images from this tar archive using the
nerdctl load command, not all container images will be loaded.

This behavior is reported and the details are described in the following:

- https://github.com/containerd/nerdctl/issues/3806

Therefore, this PR resolves this issue.

Signed-off-by: Hayato Kiwata <haytok@amazon.co.jp>
2025-01-17 09:55:40 +00:00
Akihiro Suda 5a669b8959
Merge pull request #3823 from containerd/dependabot/github_actions/golangci/golangci-lint-action-6.2.0
build(deps): bump golangci/golangci-lint-action from 6.1.1 to 6.2.0
2025-01-17 17:49:39 +09:00
Akihiro Suda f15d0adcc2
Merge pull request #3819 from haytok/fix-to-clean-up-an-orphaned-etchosts-directory
fix: clean up an orphaned etchosts directory for the container that failed to create
2025-01-17 17:47:24 +09:00
dependabot[bot] ae9894e35a
build(deps): bump golangci/golangci-lint-action from 6.1.1 to 6.2.0
Bumps [golangci/golangci-lint-action](https://github.com/golangci/golangci-lint-action) from 6.1.1 to 6.2.0.
- [Release notes](https://github.com/golangci/golangci-lint-action/releases)
- [Commits](971e284b60...ec5d18412c)

---
updated-dependencies:
- dependency-name: golangci/golangci-lint-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-01-16 22:20:34 +00:00
zzzzzzzzzy9 ef26ad8fc3 reset spec if update returned error
Signed-off-by: zzzzzzzzzy9 <zhang.yu58@zte.com.cn>
2025-01-16 09:29:35 +08:00
dependabot[bot] 7a4c25281e
build(deps): bump docker/build-push-action from 6.11.0 to 6.12.0
Bumps [docker/build-push-action](https://github.com/docker/build-push-action) from 6.11.0 to 6.12.0.
- [Release notes](https://github.com/docker/build-push-action/releases)
- [Commits](b32b51a8ed...67a2d409c0)

---
updated-dependencies:
- dependency-name: docker/build-push-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-01-15 22:14:14 +00:00
Hayato Kiwata fcb900e9a3 test: Add an test for added logic to TestRunWithInvalidPortThenCleanUp
This commit adds an test for added logic to clean up an orphaned etchosts
directory for the container that failed to create to
TestRunWithInvalidPortThenCleanUp.

Signed-off-by: Hayato Kiwata <haytok@amazon.co.jp>
2025-01-15 15:54:39 +00:00
Hayato Kiwata 7bfbd31f48 fix: Add the logic to clean up an orphaned etchosts directory
This commit adds the logic to clean up an orphaned etchosts directory for
the container that failed to create.

Signed-off-by: Hayato Kiwata <haytok@amazon.co.jp>
2025-01-15 15:52:37 +00:00
Hayato Kiwata e3d27107de test: refactor TestRunWithInvalidPortThenCleanUp
This commit refactors TestRunWithInvalidPortThenCleanUp in
cmd/nerdctl/container/container_run_network_linux_test.go based on the
principles in the following document.

- https://github.com/containerd/nerdctl/tree/main/docs/testing#principles

Signed-off-by: Hayato Kiwata <haytok@amazon.co.jp>
2025-01-15 15:49:53 +00:00
Jin Dong 1259a55e61
Merge pull request #3817 from containerd/dependabot/go_modules/github.com/containerd/containerd/v2-2.0.2 2025-01-14 08:36:18 -05:00
dependabot[bot] 70bed8df81
build(deps): bump github.com/containerd/containerd/v2
Bumps [github.com/containerd/containerd/v2](https://github.com/containerd/containerd) from 2.0.1 to 2.0.2.
- [Release notes](https://github.com/containerd/containerd/releases)
- [Changelog](https://github.com/containerd/containerd/blob/main/RELEASES.md)
- [Commits](https://github.com/containerd/containerd/compare/v2.0.1...v2.0.2)

---
updated-dependencies:
- dependency-name: github.com/containerd/containerd/v2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-01-14 07:24:36 +00:00
Akihiro Suda 4be793b61c
Merge pull request #3813 from containerd/dependabot/go_modules/docker-b05a34e46e
build(deps): bump the docker group with 2 updates
2025-01-14 15:47:07 +09:00
Akihiro Suda ab3bdf47cb
Merge pull request #3815 from containerd/dependabot/go_modules/github.com/containerd/platforms-1.0.0-rc.1
build(deps): bump github.com/containerd/platforms from 1.0.0-rc.0 to 1.0.0-rc.1
2025-01-14 14:37:08 +09:00
dependabot[bot] 251c56d406
build(deps): bump the docker group with 2 updates
Bumps the docker group with 2 updates: [github.com/docker/cli](https://github.com/docker/cli) and [github.com/docker/docker](https://github.com/docker/docker).


Updates `github.com/docker/cli` from 27.4.1+incompatible to 27.5.0+incompatible
- [Commits](https://github.com/docker/cli/compare/v27.4.1...v27.5.0)

Updates `github.com/docker/docker` from 27.4.1+incompatible to 27.5.0+incompatible
- [Release notes](https://github.com/docker/docker/releases)
- [Commits](https://github.com/docker/docker/compare/v27.4.1...v27.5.0)

---
updated-dependencies:
- dependency-name: github.com/docker/cli
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: docker
- dependency-name: github.com/docker/docker
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: docker
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-01-14 04:04:27 +00:00
Jin Dong aea28bf764
Merge pull request #3814 from containerd/dependabot/go_modules/github.com/cyphar/filepath-securejoin-0.4.0
build(deps): bump github.com/cyphar/filepath-securejoin from 0.3.6 to 0.4.0
2025-01-13 23:03:10 -05:00
Jin Dong 1003083305
Merge pull request #3807 from austinvazquez/update-containerd-1.7.25-in-ci
Update containerd (1.7.25) in CI
2025-01-13 23:01:37 -05:00
Jin Dong b17b2cc94d
Merge pull request #3811 from BraveY/docs-nydus
docs: Fix incorrect parameter description in documentation of nydus
2025-01-13 23:00:30 -05:00
dependabot[bot] dfea78c98e
build(deps): bump github.com/containerd/platforms
Bumps [github.com/containerd/platforms](https://github.com/containerd/platforms) from 1.0.0-rc.0 to 1.0.0-rc.1.
- [Release notes](https://github.com/containerd/platforms/releases)
- [Commits](https://github.com/containerd/platforms/compare/v1.0.0-rc.0...v1.0.0-rc.1)

---
updated-dependencies:
- dependency-name: github.com/containerd/platforms
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-01-13 22:38:27 +00:00
dependabot[bot] 5844e84f14
build(deps): bump github.com/cyphar/filepath-securejoin
Bumps [github.com/cyphar/filepath-securejoin](https://github.com/cyphar/filepath-securejoin) from 0.3.6 to 0.4.0.
- [Release notes](https://github.com/cyphar/filepath-securejoin/releases)
- [Changelog](https://github.com/cyphar/filepath-securejoin/blob/main/CHANGELOG.md)
- [Commits](https://github.com/cyphar/filepath-securejoin/compare/v0.3.6...v0.4.0)

---
updated-dependencies:
- dependency-name: github.com/cyphar/filepath-securejoin
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-01-13 22:38:19 +00:00
Austin Vazquez 6ab1907a0d
Update containerd (1.7.25) in CI
Signed-off-by: Austin Vazquez <macedonv@amazon.com>
2025-01-13 18:38:23 +00:00
Yang Kaiyong 2ce9918b41 docs: Fix incorrect parameter description in documentation of nydus
Signed-off-by: Yang Kaiyong <yangkaiyong.yky@antgroup.com>
2025-01-13 11:31:40 +08:00
Akihiro Suda b854127dea
Merge pull request #3810 from djdongjin/bump-up-go-cni
Bump up github.com/containerd/go-cni to 1.1.12 and fix CI
2025-01-12 18:58:40 +09:00
Jin Dong 50dd735e04 move vagrant CI to ubuntu 24.04
Signed-off-by: Jin Dong <djdongjin95@gmail.com>
2025-01-11 20:17:56 +00:00
Jin Dong 74e00af48f bump up github.com/containerd/go-cni to 1.1.12
Signed-off-by: Jin Dong <djdongjin95@gmail.com>
2025-01-11 19:52:26 +00:00
fahed dorgaa ae7a300c82
Merge pull request #3802 from containerd/dependabot/github_actions/docker/setup-qemu-action-3.3.0
build(deps): bump docker/setup-qemu-action from 3.2.0 to 3.3.0
2025-01-10 15:28:37 +01:00
fahed dorgaa 3961f26425
Merge pull request #3803 from containerd/dependabot/github_actions/docker/build-push-action-6.11.0
build(deps): bump docker/build-push-action from 6.10.0 to 6.11.0
2025-01-10 15:27:46 +01:00
fahed dorgaa 751b33be9e
Merge pull request #3793 from motinsa/main
Refactor: Encapsulate net opts loading in internalLabels
2025-01-10 15:27:18 +01:00
dependabot[bot] 6ea730678b
build(deps): bump docker/build-push-action from 6.10.0 to 6.11.0
Bumps [docker/build-push-action](https://github.com/docker/build-push-action) from 6.10.0 to 6.11.0.
- [Release notes](https://github.com/docker/build-push-action/releases)
- [Commits](48aba3b46d...b32b51a8ed)

---
updated-dependencies:
- dependency-name: docker/build-push-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-01-08 22:38:32 +00:00
dependabot[bot] 690bbbfeec
build(deps): bump docker/setup-qemu-action from 3.2.0 to 3.3.0
Bumps [docker/setup-qemu-action](https://github.com/docker/setup-qemu-action) from 3.2.0 to 3.3.0.
- [Release notes](https://github.com/docker/setup-qemu-action/releases)
- [Commits](49b3bc8e6b...53851d1459)

---
updated-dependencies:
- dependency-name: docker/setup-qemu-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-01-08 22:38:29 +00:00
Jin Dong f5e58defcf
Merge pull request #3801 from containerd/dependabot/go_modules/github.com/compose-spec/compose-go/v2-2.4.7
build(deps): bump github.com/compose-spec/compose-go/v2 from 2.4.6 to 2.4.7
2025-01-07 21:39:52 -05:00
dependabot[bot] 25ca668009
build(deps): bump github.com/compose-spec/compose-go/v2
Bumps [github.com/compose-spec/compose-go/v2](https://github.com/compose-spec/compose-go) from 2.4.6 to 2.4.7.
- [Release notes](https://github.com/compose-spec/compose-go/releases)
- [Commits](https://github.com/compose-spec/compose-go/compare/v2.4.6...v2.4.7)

---
updated-dependencies:
- dependency-name: github.com/compose-spec/compose-go/v2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-01-07 22:48:49 +00:00
Akihiro Suda 0184c43ce8
Merge pull request #3795 from containerd/dependabot/go_modules/golang-x-2d5cf4282f
build(deps): bump the golang-x group with 4 updates
2025-01-08 03:52:05 +09:00
Akihiro Suda bcf15a115e
Merge pull request #3799 from austinvazquez/update-runc-v1.2.4
update runc (1.2.4)
2025-01-08 03:51:50 +09:00
Akihiro Suda 40b17cd79a
Merge pull request #3800 from djdongjin/remove-cni-1-6-1-checksum
Remove old cni 1.6.1 checksum file
2025-01-08 03:51:32 +09:00
Jin Dong 9ef95396f5 remove old cni 1.6.1 checksum file
Signed-off-by: Jin Dong <djdongjin95@gmail.com>
2025-01-07 17:22:34 +00:00
Akihiro Suda 9ffc5c1088
Merge pull request #3766 from apostasie/fix-3748
When the port is 443, also save credentials without port
2025-01-08 02:13:58 +09:00
Austin Vazquez fa3a4fa5e5
update runc (1.2.4)
Signed-off-by: Austin Vazquez <macedonv@amazon.com>
2025-01-07 16:58:40 +00:00
dependabot[bot] 8a1fd9ebec
build(deps): bump the golang-x group with 4 updates
Bumps the golang-x group with 4 updates: [golang.org/x/crypto](https://github.com/golang/crypto), [golang.org/x/net](https://github.com/golang/net), [golang.org/x/sys](https://github.com/golang/sys) and [golang.org/x/term](https://github.com/golang/term).


Updates `golang.org/x/crypto` from 0.31.0 to 0.32.0
- [Commits](https://github.com/golang/crypto/compare/v0.31.0...v0.32.0)

Updates `golang.org/x/net` from 0.33.0 to 0.34.0
- [Commits](https://github.com/golang/net/compare/v0.33.0...v0.34.0)

Updates `golang.org/x/sys` from 0.28.0 to 0.29.0
- [Commits](https://github.com/golang/sys/compare/v0.28.0...v0.29.0)

Updates `golang.org/x/term` from 0.27.0 to 0.28.0
- [Commits](https://github.com/golang/term/compare/v0.27.0...v0.28.0)

---
updated-dependencies:
- dependency-name: golang.org/x/crypto
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: golang-x
- dependency-name: golang.org/x/net
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: golang-x
- dependency-name: golang.org/x/sys
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: golang-x
- dependency-name: golang.org/x/term
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: golang-x
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-01-07 12:48:06 +00:00
Jin Dong 1b98a5e695
Merge pull request #3797 from djdongjin/cni-1-6-2
update CNI plugins (1.6.2)
2025-01-07 07:46:41 -05:00
Jin Dong b0e78eeeca update CNI plugins (1.6.2)
Signed-off-by: Jin Dong <djdongjin95@gmail.com>
2025-01-07 03:10:55 +00:00
Jin Dong e6132a7a13
Merge pull request #3794 from containerd/dependabot/go_modules/github.com/moby/term-0.5.2
build(deps): bump github.com/moby/term from 0.5.0 to 0.5.2
2025-01-05 16:26:16 -05:00
Akihiro Suda 84fbcf8a39
Merge pull request #3744 from fengwei0328/dev1
Fix duplicate image entries in k8s.io namespaces
2025-01-06 00:05:19 +09:00
Akihiro Suda df40602210
Merge pull request #3781 from ningmingxiao/fix_update
update:fix update pids-limit=0 error
2025-01-05 23:50:22 +09:00
dependabot[bot] 1a79790b80
build(deps): bump github.com/moby/term from 0.5.0 to 0.5.2
Bumps [github.com/moby/term](https://github.com/moby/term) from 0.5.0 to 0.5.2.
- [Commits](https://github.com/moby/term/compare/v0.5.0...v0.5.2)

---
updated-dependencies:
- dependency-name: github.com/moby/term
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-01-03 22:56:38 +00:00
Pedro Aibar d6248ac109 Refactor: Change function loadNetOpts from public to private
Signed-off-by: Pedro Aibar <pedroaibarmarco@gmail.com>
2025-01-02 09:54:56 +00:00
Pedro Aibar 842be9a257
Refactor: Encapsulate net opts loading in internalLabels
Signed-off-by: Pedro Aibar <75799784+motinsa@users.noreply.github.com>
2024-12-29 20:27:23 +01:00
Jin Dong f917e5c1c8
Merge pull request #3792 from austinvazquez/fix-inspect-err-dnf 2024-12-29 07:47:57 -05:00
Austin Vazquez aa5eb28ade
Fix image inspect exit code on image not found error
This change fixes image inspect command to error when image is not
found.

Signed-off-by: Austin Vazquez <macedonv@amazon.com>
2024-12-28 19:36:57 -07:00
Akihiro Suda 6f34536582
Merge pull request #3323 from apostasie/b-dev-cp
Rewrite cp
2024-12-26 01:16:14 +09:00
ningmingxiao 75c8066343 update:fix update pids-limit=0 error
Signed-off-by: ningmingxiao <ning.mingxiao@zte.com.cn>
2024-12-24 19:15:00 +08:00
fengwei0328 eaa8df0b50 Fix duplicate image entries in k8s.io namespaces
The same imageId underk8s.io is showing multiple results: repo:tag, repo:digest, configID.
We expect to display only repo:tag, consistent with other namespaces and CRI.
		e.g.
		nerdctl -n k8s.io images
		REPOSITORY    TAG       IMAGE ID        CREATED        PLATFORM       SIZE         BLOB SIZE
		centos        7         be65f488b776    3 hours ago    linux/amd64    211.5 MiB    72.6 MiB
		centos        <none>    be65f488b776    3 hours ago    linux/amd64    211.5 MiB    72.6 MiB
		<none>        <none>    be65f488b776    3 hours ago    linux/amd64    211.5 MiB    72.6 MiB

		expect:
		nerdctl --kube-hide-dupe -n k8s.io images
		REPOSITORY    TAG       IMAGE ID        CREATED        PLATFORM       SIZE         BLOB SIZE
		centos        7         be65f488b776    3 hours ago    linux/amd64    211.5 MiB    72.6 MiB
Of course, even after deduplicating the images displayed, there are still issues with deleting the images.
It is necessary to distinguish between repo:tag and configId, as well as repoDigest. Considering the situation with tags,
we need to ensure that all repo:tags under the same imageId are cleaned up before proceeding to clean up the configId and repoDigest.

see: https://github.com/containerd/nerdctl/issues/3702

Signed-off-by: fengwei0328 <feng.wei8@zte.com.cn>
2024-12-24 17:13:00 +08:00
Akihiro Suda 3cf690340d
Merge pull request #3780 from ningmingxiao/add_ulimit_doc
doc:add some doc for ulimit
2024-12-24 16:14:11 +09:00
Akihiro Suda 8ed777d377
Merge pull request #3786 from austinvazquez/feat-build-add-host
Add nerdctl build --add-host option support
2024-12-24 16:13:30 +09:00
Austin Vazquez f3f83100ab
Add nerdctl build --add-host option support
This change refactors the parse extra hosts logic from container run
command and adds support for image build add-host flag.

Signed-off-by: Austin Vazquez <macedonv@amazon.com>
2024-12-23 22:14:41 -07:00
Akihiro Suda 35213f39b1
Merge pull request #3778 from containerd/dependabot/go_modules/golang-x-232a611e2d
build(deps): bump golang.org/x/net from 0.32.0 to 0.33.0 in the golang-x group
2024-12-20 22:38:42 +09:00
Akihiro Suda 5fbd493d0e
Merge pull request #3782 from containerd/dependabot/go_modules/github.com/containerd/cgroups/v3-3.0.5
build(deps): bump github.com/containerd/cgroups/v3 from 3.0.4 to 3.0.5
2024-12-20 17:21:23 +09:00
Akihiro Suda c5b57fa2f6
Merge pull request #3773 from yankay/fix-pull-image-process-to-stderr2
Fix pull image process output from stderr to stdout
2024-12-20 15:01:12 +09:00
ningmingxiao b26474b275 doc:add some doc for ulimit
Signed-off-by: ningmingxiao <ning.mingxiao@zte.com.cn>
2024-12-20 11:48:46 +08:00
Kay Yan 3dbd24cfd2
fix pull image process output from stderr to stdout
Signed-off-by: Kay Yan <kay.yan@daocloud.io>
2024-12-20 02:07:33 +00:00
dependabot[bot] 8b5bb67331
build(deps): bump github.com/containerd/cgroups/v3 from 3.0.4 to 3.0.5
Bumps [github.com/containerd/cgroups/v3](https://github.com/containerd/cgroups) from 3.0.4 to 3.0.5.
- [Release notes](https://github.com/containerd/cgroups/releases)
- [Commits](https://github.com/containerd/cgroups/compare/v3.0.4...v3.0.5)

---
updated-dependencies:
- dependency-name: github.com/containerd/cgroups/v3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-12-19 22:14:47 +00:00
dependabot[bot] 25e4f3fdaa
build(deps): bump golang.org/x/net in the golang-x group
Bumps the golang-x group with 1 update: [golang.org/x/net](https://github.com/golang/net).


Updates `golang.org/x/net` from 0.32.0 to 0.33.0
- [Commits](https://github.com/golang/net/compare/v0.32.0...v0.33.0)

---
updated-dependencies:
- dependency-name: golang.org/x/net
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: golang-x
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-12-19 22:14:32 +00:00
Akihiro Suda c41b394dc2
Merge pull request #3779 from containerd/dependabot/go_modules/docker-0eae3ea95f
build(deps): bump the docker group with 2 updates
2024-12-19 09:15:57 +09:00
Akihiro Suda dab134f18e
Merge pull request #3777 from apostasie/fix-3769
Fix wrong commit sha for golangci action
2024-12-19 09:15:33 +09:00
dependabot[bot] b777a65f41
build(deps): bump the docker group with 2 updates
Bumps the docker group with 2 updates: [github.com/docker/cli](https://github.com/docker/cli) and [github.com/docker/docker](https://github.com/docker/docker).


Updates `github.com/docker/cli` from 27.4.0+incompatible to 27.4.1+incompatible
- [Commits](https://github.com/docker/cli/compare/v27.4.0...v27.4.1)

Updates `github.com/docker/docker` from 27.4.0+incompatible to 27.4.1+incompatible
- [Release notes](https://github.com/docker/docker/releases)
- [Commits](https://github.com/docker/docker/compare/v27.4.0...v27.4.1)

---
updated-dependencies:
- dependency-name: github.com/docker/cli
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: docker
- dependency-name: github.com/docker/docker
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: docker
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-12-18 22:28:39 +00:00
apostasie 49bf063ef8
Fix wrong commit sha for golangci action
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2024-12-18 11:35:32 -08:00
Akihiro Suda c894bb4edb
Merge pull request #3775 from containerd/dependabot/go_modules/github.com/cyphar/filepath-securejoin-0.3.6
build(deps): bump github.com/cyphar/filepath-securejoin from 0.3.5 to 0.3.6
2024-12-18 13:35:32 +09:00
Akihiro Suda 8972500c74
Merge pull request #3774 from yankay/update-deps
update containerd (2.0.1), runc (1.2.3), buildKit (0.18.2), etc.
2024-12-18 13:35:14 +09:00
dependabot[bot] 98ea42dc0d
build(deps): bump github.com/cyphar/filepath-securejoin
Bumps [github.com/cyphar/filepath-securejoin](https://github.com/cyphar/filepath-securejoin) from 0.3.5 to 0.3.6.
- [Release notes](https://github.com/cyphar/filepath-securejoin/releases)
- [Changelog](https://github.com/cyphar/filepath-securejoin/blob/main/CHANGELOG.md)
- [Commits](https://github.com/cyphar/filepath-securejoin/compare/v0.3.5...v0.3.6)

---
updated-dependencies:
- dependency-name: github.com/cyphar/filepath-securejoin
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-12-17 22:37:35 +00:00
Kay Yan ef02692a91
update containerd (2.0.1), runc (1.2.3), buildKit (0.18.2), stargz-snapshotter (0.16.3)
Signed-off-by: Kay Yan <kay.yan@daocloud.io>
2024-12-17 06:39:18 +00:00
Jin Dong 0e5f7fd88b
Merge pull request #3769 from containerd/dependabot/github_actions/golangci/golangci-lint-action-9937fdf7189f2958a2dc9f6d585e5d65e3326d20
build(deps): bump golangci/golangci-lint-action from 774c35bcccffb734694af9e921f12f57d882ef74 to 9937fdf7189f2958a2dc9f6d585e5d65e3326d20
2024-12-16 20:41:03 -05:00
Jin Dong 337154caab
Merge pull request #3768 from containerd/dependabot/go_modules/github.com/containerd/imgcrypt/v2-2.0.0
build(deps): bump github.com/containerd/imgcrypt/v2 from 2.0.0-rc.1 to 2.0.0
2024-12-16 20:10:58 -05:00
Jin Dong d062b17b07
Merge pull request #3767 from containerd/dependabot/go_modules/github.com/containerd/containerd/v2-2.0.1
build(deps): bump github.com/containerd/containerd/v2 from 2.0.0 to 2.0.1
2024-12-16 20:10:14 -05:00
Jin Dong 6ee9a834eb
Merge pull request #3770 from containerd/dependabot/github_actions/docker/setup-buildx-action-3.8.0
build(deps): bump docker/setup-buildx-action from 3.7.1 to 3.8.0
2024-12-16 20:09:32 -05:00
dependabot[bot] 98e939cef8
build(deps): bump docker/setup-buildx-action from 3.7.1 to 3.8.0
Bumps [docker/setup-buildx-action](https://github.com/docker/setup-buildx-action) from 3.7.1 to 3.8.0.
- [Release notes](https://github.com/docker/setup-buildx-action/releases)
- [Commits](c47758b77c...6524bf65af)

---
updated-dependencies:
- dependency-name: docker/setup-buildx-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-12-16 22:20:58 +00:00
dependabot[bot] 2d79e100d1
build(deps): bump golangci/golangci-lint-action
Bumps [golangci/golangci-lint-action](https://github.com/golangci/golangci-lint-action) from 774c35bcccffb734694af9e921f12f57d882ef74 to 9937fdf7189f2958a2dc9f6d585e5d65e3326d20.
- [Release notes](https://github.com/golangci/golangci-lint-action/releases)
- [Commits](774c35bccc...9937fdf718)

---
updated-dependencies:
- dependency-name: golangci/golangci-lint-action
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-12-16 22:20:55 +00:00
dependabot[bot] ad49550784
build(deps): bump github.com/containerd/imgcrypt/v2
Bumps [github.com/containerd/imgcrypt/v2](https://github.com/containerd/imgcrypt) from 2.0.0-rc.1 to 2.0.0.
- [Release notes](https://github.com/containerd/imgcrypt/releases)
- [Changelog](https://github.com/containerd/imgcrypt/blob/main/CHANGES)
- [Commits](https://github.com/containerd/imgcrypt/compare/v2.0.0-rc.1...v2.0.0)

---
updated-dependencies:
- dependency-name: github.com/containerd/imgcrypt/v2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-12-16 22:17:44 +00:00
dependabot[bot] 2ae8ca7eaa
build(deps): bump github.com/containerd/containerd/v2
Bumps [github.com/containerd/containerd/v2](https://github.com/containerd/containerd) from 2.0.0 to 2.0.1.
- [Release notes](https://github.com/containerd/containerd/releases)
- [Changelog](https://github.com/containerd/containerd/blob/main/RELEASES.md)
- [Commits](https://github.com/containerd/containerd/compare/v2.0.0...v2.0.1)

---
updated-dependencies:
- dependency-name: github.com/containerd/containerd/v2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-12-16 22:17:33 +00:00
apostasie 7a69f5d854
When the port is 443, also save credentials without port
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2024-12-16 13:54:59 -08:00
Akihiro Suda 7e97f0618c
Merge pull request #3739 from apostasie/ci-cleanup
Small Ci adjustments & cleanups
2024-12-15 00:57:38 +09:00
apostasie 6e913a6356
Remove spurious cache true, default for action/go
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2024-12-13 12:54:38 -08:00
apostasie db52916436
Switch github actions to commit sha
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2024-12-13 12:54:35 -08:00
Kohei Tokunaga fd217a03a4
Merge pull request #3758 from containerd/dependabot/go_modules/stargz-b96e49634a
build(deps): bump the stargz group with 3 updates
2024-12-13 16:37:45 +09:00
dependabot[bot] a252d35546
build(deps): bump the stargz group with 3 updates
Bumps the stargz group with 3 updates: [github.com/containerd/stargz-snapshotter](https://github.com/containerd/stargz-snapshotter), [github.com/containerd/stargz-snapshotter/estargz](https://github.com/containerd/stargz-snapshotter) and [github.com/containerd/stargz-snapshotter/ipfs](https://github.com/containerd/stargz-snapshotter).


Updates `github.com/containerd/stargz-snapshotter` from 0.16.2 to 0.16.3
- [Release notes](https://github.com/containerd/stargz-snapshotter/releases)
- [Commits](https://github.com/containerd/stargz-snapshotter/compare/v0.16.2...v0.16.3)

Updates `github.com/containerd/stargz-snapshotter/estargz` from 0.16.2 to 0.16.3
- [Release notes](https://github.com/containerd/stargz-snapshotter/releases)
- [Commits](https://github.com/containerd/stargz-snapshotter/compare/v0.16.2...v0.16.3)

Updates `github.com/containerd/stargz-snapshotter/ipfs` from 0.16.2 to 0.16.3
- [Release notes](https://github.com/containerd/stargz-snapshotter/releases)
- [Commits](https://github.com/containerd/stargz-snapshotter/compare/v0.16.2...v0.16.3)

---
updated-dependencies:
- dependency-name: github.com/containerd/stargz-snapshotter
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: stargz
- dependency-name: github.com/containerd/stargz-snapshotter/estargz
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: stargz
- dependency-name: github.com/containerd/stargz-snapshotter/ipfs
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: stargz
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-12-12 22:44:14 +00:00
Jin Dong 6f5589637e
Merge pull request #3754 from containerd/dependabot/go_modules/github.com/compose-spec/compose-go/v2-2.4.6
build(deps): bump github.com/compose-spec/compose-go/v2 from 2.4.5 to 2.4.6
2024-12-11 22:09:44 -05:00
apostasie 47d6d0ad26
cp integration tests
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2024-12-11 19:02:26 -08:00
apostasie e30a362c8e
Rewrite cp
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2024-12-11 19:02:25 -08:00
Akihiro Suda 444c17202a
Merge pull request #3741 from miurahr/topic/miurahr/docs/nerdctl-builder-prune-target-folder
docs: add faq tips for buildkit cache folder clean-ups
2024-12-12 08:47:12 +09:00
Akihiro Suda 580d47c5ec
Merge pull request #3745 from manugupt1/docker-compose-up-pull
3432: Support --pull flag in nerdctl compose up
2024-12-12 08:46:14 +09:00
Akihiro Suda cc9a3fca47
Merge pull request #3753 from containerd/dependabot/go_modules/github.com/containerd/nydus-snapshotter-0.15.0
build(deps): bump github.com/containerd/nydus-snapshotter from 0.15.0-rc.0 to 0.15.0
2024-12-12 08:45:17 +09:00
Akihiro Suda 79e4f17b71
Merge pull request #3752 from containerd/dependabot/go_modules/golang-x-5a9c29dde4
build(deps): bump golang.org/x/crypto from 0.30.0 to 0.31.0 in the golang-x group
2024-12-12 08:44:59 +09:00
dependabot[bot] db82f095ea
build(deps): bump github.com/compose-spec/compose-go/v2
Bumps [github.com/compose-spec/compose-go/v2](https://github.com/compose-spec/compose-go) from 2.4.5 to 2.4.6.
- [Release notes](https://github.com/compose-spec/compose-go/releases)
- [Commits](https://github.com/compose-spec/compose-go/compare/v2.4.5...v2.4.6)

---
updated-dependencies:
- dependency-name: github.com/compose-spec/compose-go/v2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-12-11 22:31:06 +00:00
dependabot[bot] 8aa71696c3
build(deps): bump github.com/containerd/nydus-snapshotter
Bumps [github.com/containerd/nydus-snapshotter](https://github.com/containerd/nydus-snapshotter) from 0.15.0-rc.0 to 0.15.0.
- [Release notes](https://github.com/containerd/nydus-snapshotter/releases)
- [Commits](https://github.com/containerd/nydus-snapshotter/compare/v0.15.0-rc.0...v0.15.0)

---
updated-dependencies:
- dependency-name: github.com/containerd/nydus-snapshotter
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-12-11 22:30:57 +00:00
dependabot[bot] 5dfc39e9d4
build(deps): bump golang.org/x/crypto in the golang-x group
Bumps the golang-x group with 1 update: [golang.org/x/crypto](https://github.com/golang/crypto).


Updates `golang.org/x/crypto` from 0.30.0 to 0.31.0
- [Commits](https://github.com/golang/crypto/compare/v0.30.0...v0.31.0)

---
updated-dependencies:
- dependency-name: golang.org/x/crypto
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: golang-x
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-12-11 22:30:50 +00:00
Hiroshi Miura 1185e8e2a4
docs: add faq tips for buildkit cache folder
Help users to find a nerdctl command when they find a dangling cache in
buildkit cache folder, as a SEO.

Signed-off-by: Hiroshi Miura <miurahr@linux.com>
2024-12-12 00:02:43 +09:00
Akihiro Suda bf01328a83
Merge pull request #3749 from containerd/dependabot/docker/tonistiigi/xx-1.6.1
build(deps): bump tonistiigi/xx from 1.6.0 to 1.6.1
2024-12-11 23:06:08 +09:00
Akihiro Suda 5736ded751
Merge pull request #3750 from containerd/dependabot/go_modules/github.com/containerd/go-cni-1.1.11
build(deps): bump github.com/containerd/go-cni from 1.1.10 to 1.1.11
2024-12-11 23:05:48 +09:00
Manu Gupta e3b231e69d 3432: Support --pull flag in nerdctl compose up
Signed-off-by: Manu Gupta <manugupt1@gmail.com>
2024-12-10 22:37:10 -08:00
dependabot[bot] bd66dc0b0e
build(deps): bump github.com/containerd/go-cni from 1.1.10 to 1.1.11
Bumps [github.com/containerd/go-cni](https://github.com/containerd/go-cni) from 1.1.10 to 1.1.11.
- [Release notes](https://github.com/containerd/go-cni/releases)
- [Commits](https://github.com/containerd/go-cni/compare/v1.1.10...v1.1.11)

---
updated-dependencies:
- dependency-name: github.com/containerd/go-cni
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-12-10 22:58:00 +00:00
dependabot[bot] 9e5a01342e
build(deps): bump tonistiigi/xx from 1.6.0 to 1.6.1
Bumps tonistiigi/xx from 1.6.0 to 1.6.1.

---
updated-dependencies:
- dependency-name: tonistiigi/xx
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-12-10 22:51:38 +00:00
Akihiro Suda 1220ce7ec2
Merge pull request #3746 from AkihiroSuda/dev
update BuildKit (0.18.1), containerd-fuse-overlayfs (2.1.0)
2024-12-10 22:57:14 +09:00
Akihiro Suda bcc9fa746a
update containerd-fuse-overlayfs (2.1.0)
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2024-12-10 17:43:14 +09:00
Akihiro Suda 6dac2cf127
update BuildKit (0.18.1)
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2024-12-10 17:31:06 +09:00
Akihiro Suda 407f5fcc48
Merge pull request #3740 from fahedouch/improve-rootless-doc
[doc] rootlesskit port driver configuration
2024-12-10 16:02:46 +09:00
Jin Dong 00f6acd7fa
Merge pull request #3742 from containerd/dependabot/go_modules/docker-2e8e87be6b
build(deps): bump the docker group with 2 updates
2024-12-09 18:40:38 -05:00
Jin Dong 17eeb5b535
Merge pull request #3743 from containerd/dependabot/docker/tonistiigi/xx-1.6.0
build(deps): bump tonistiigi/xx from 1.5.0 to 1.6.0
2024-12-09 18:40:27 -05:00
dependabot[bot] f934774245
build(deps): bump tonistiigi/xx from 1.5.0 to 1.6.0
Bumps tonistiigi/xx from 1.5.0 to 1.6.0.

---
updated-dependencies:
- dependency-name: tonistiigi/xx
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-12-09 22:39:19 +00:00
dependabot[bot] e8bca25104
build(deps): bump the docker group with 2 updates
Bumps the docker group with 2 updates: [github.com/docker/cli](https://github.com/docker/cli) and [github.com/docker/docker](https://github.com/docker/docker).


Updates `github.com/docker/cli` from 27.3.1+incompatible to 27.4.0+incompatible
- [Commits](https://github.com/docker/cli/compare/v27.3.1...v27.4.0)

Updates `github.com/docker/docker` from 27.3.1+incompatible to 27.4.0+incompatible
- [Release notes](https://github.com/docker/docker/releases)
- [Commits](https://github.com/docker/docker/compare/v27.3.1...v27.4.0)

---
updated-dependencies:
- dependency-name: github.com/docker/cli
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: docker
- dependency-name: github.com/docker/docker
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: docker
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-12-09 22:36:14 +00:00
Akihiro Suda 84fc73414d
Merge pull request #3738 from containerd/dependabot/go_modules/github.com/cyphar/filepath-securejoin-0.3.5
build(deps): bump github.com/cyphar/filepath-securejoin from 0.3.4 to 0.3.5
2024-12-08 19:16:08 +09:00
fahed dorgaa e3e6c3dec6
[doc] rootlesskit port driver configuration
Signed-off-by: fahed dorgaa <fahed.dorgaa@gmail.com>
2024-12-07 22:29:16 +01:00
dependabot[bot] c2d8b4c6da
build(deps): bump github.com/cyphar/filepath-securejoin
Bumps [github.com/cyphar/filepath-securejoin](https://github.com/cyphar/filepath-securejoin) from 0.3.4 to 0.3.5.
- [Release notes](https://github.com/cyphar/filepath-securejoin/releases)
- [Changelog](https://github.com/cyphar/filepath-securejoin/blob/main/CHANGELOG.md)
- [Commits](https://github.com/cyphar/filepath-securejoin/compare/v0.3.4...v0.3.5)

---
updated-dependencies:
- dependency-name: github.com/cyphar/filepath-securejoin
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-12-06 22:45:02 +00:00
Jin Dong f3191c40dc
Merge pull request #3729 from apostasie/more-tests
Chore: spurious helpers test cleanup
2024-12-06 15:19:20 -05:00
Akihiro Suda ab704e9559
Merge pull request #3723 from apostasie/namespace-validate
Cleanup namespace validation
2024-12-05 18:50:35 +09:00
Akihiro Suda 3206b49dc5
Merge pull request #3732 from containerd/dependabot/go_modules/golang-x-8e238996ae
build(deps): bump the golang-x group with 6 updates
2024-12-05 10:13:53 +09:00
Akihiro Suda 0c0737ddb7
Merge pull request #3703 from coderbirju/fix-env-file-bug
fix: enable --env-file flag behavior in nerdctl compose
2024-12-05 09:18:03 +09:00
dependabot[bot] b4ba0cbdd3
build(deps): bump the golang-x group with 6 updates
Bumps the golang-x group with 6 updates:

| Package | From | To |
| --- | --- | --- |
| [golang.org/x/crypto](https://github.com/golang/crypto) | `0.29.0` | `0.30.0` |
| [golang.org/x/net](https://github.com/golang/net) | `0.31.0` | `0.32.0` |
| [golang.org/x/sync](https://github.com/golang/sync) | `0.9.0` | `0.10.0` |
| [golang.org/x/sys](https://github.com/golang/sys) | `0.27.0` | `0.28.0` |
| [golang.org/x/term](https://github.com/golang/term) | `0.26.0` | `0.27.0` |
| [golang.org/x/text](https://github.com/golang/text) | `0.20.0` | `0.21.0` |


Updates `golang.org/x/crypto` from 0.29.0 to 0.30.0
- [Commits](https://github.com/golang/crypto/compare/v0.29.0...v0.30.0)

Updates `golang.org/x/net` from 0.31.0 to 0.32.0
- [Commits](https://github.com/golang/net/compare/v0.31.0...v0.32.0)

Updates `golang.org/x/sync` from 0.9.0 to 0.10.0
- [Commits](https://github.com/golang/sync/compare/v0.9.0...v0.10.0)

Updates `golang.org/x/sys` from 0.27.0 to 0.28.0
- [Commits](https://github.com/golang/sys/compare/v0.27.0...v0.28.0)

Updates `golang.org/x/term` from 0.26.0 to 0.27.0
- [Commits](https://github.com/golang/term/compare/v0.26.0...v0.27.0)

Updates `golang.org/x/text` from 0.20.0 to 0.21.0
- [Release notes](https://github.com/golang/text/releases)
- [Commits](https://github.com/golang/text/compare/v0.20.0...v0.21.0)

---
updated-dependencies:
- dependency-name: golang.org/x/crypto
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: golang-x
- dependency-name: golang.org/x/net
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: golang-x
- dependency-name: golang.org/x/sync
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: golang-x
- dependency-name: golang.org/x/sys
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: golang-x
- dependency-name: golang.org/x/term
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: golang-x
- dependency-name: golang.org/x/text
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: golang-x
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-12-04 22:11:09 +00:00
Arjun Raja Yogidas d4130581d7 fix: Fix --env-file flag behavior in nerdctl compose
Signed-off-by: Arjun Raja Yogidas <arjunry@amazon.com>
2024-12-04 21:51:21 +00:00
apostasie b8f4d9c2f7
Cleanup namespace validation
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2024-12-04 11:12:47 -08:00
Jin Dong 1f8fe6ae70
Merge pull request #3725 from apostasie/fs-tests
validatePathComponent tests
2024-12-04 12:33:49 -05:00
Akihiro Suda 03f0862050
Merge pull request #3728 from apostasie/chore-import-cleanup
Chore: import cleanup
2024-12-05 00:22:33 +09:00
Jin Dong a5ab79c9ee
Merge pull request #3726 from apostasie/ci-fix-timeouts
Increase timeouts on CI
2024-12-04 10:03:04 -05:00
apostasie 3d944cb5eb
validatePathComponent tests
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2024-12-03 21:37:28 -08:00
apostasie 9bbf24dbf3
Remove dependency on misplaced helper CreateBuildContext for next-gen tests
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2024-12-03 17:51:43 -08:00
apostasie e536ed59e1
Increase timeouts on CI
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2024-12-03 17:15:13 -08:00
apostasie f914ea3886
gocontext -> context
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2024-12-03 15:49:12 -08:00
apostasie 775a005375
gocni -> cni
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2024-12-03 15:49:09 -08:00
Akihiro Suda c0b8f632d6
Merge pull request #3724 from apostasie/bypass
Create directory for bypass4netns pid file
2024-12-03 22:03:29 +09:00
apostasie 32ab7472f3
Create directory for bypass4netns pid file
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2024-12-02 21:43:21 -08:00
Akihiro Suda eed44801e8
Merge pull request #3687 from pendo324/add-no-recreate-to-up
feat: add force-recreate and no-recreate for compose up command
2024-12-03 13:03:19 +09:00
Akihiro Suda 051b047a39
Merge pull request #3720 from apostasie/fix-3697
Fix hosts.toml resolution for docker domain
2024-12-03 13:01:32 +09:00
Akihiro Suda 6537124a7a
Merge pull request #3716 from apostasie/fix-3691
Enhance CNI config load error condition UX
2024-12-03 12:40:55 +09:00
Akihiro Suda 9b679746b4
Merge pull request #3718 from apostasie/logs-flaky
Marking TestCreate/logs as flaky
2024-12-03 12:40:37 +09:00
Akihiro Suda 43d3a05ec1
Merge pull request #3715 from apostasie/fix-compose-locking
Relax compose concurrency lock
2024-12-03 12:40:12 +09:00
apostasie e2708fb59b
Fix hosts.toml resolution for docker domain
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2024-12-02 16:01:22 -08:00
apostasie e28491fa2b
Enhance CNI config load error condition UX
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2024-12-02 15:14:38 -08:00
apostasie 531e203682
Marking TestCreate/logs as flaky
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2024-12-02 14:18:30 -08:00
Justin Alvarez 69de5dd492
feat: add force-recreate and no-recreate for compose up command
Signed-off-by: Justin Alvarez <alvajus@amazon.com>
2024-12-02 21:39:56 +00:00
apostasie 5fa9f123ee
Relax compose concurrency lock
Since compose implementation is currently unsafe to use concurrently, https://github.com/containerd/nerdctl/pull/3543 did introduce a blanket
locking mechanism for any and all compose operations.

However, an unintended side-effect is that a call to `compose logs`, or other operations being called in no-detach mode, would effectively
prevent the user from performing any further operation until these are quitting.

This commit does make it so a call to `composer.Logs` does release the lock.

Note the lock logic has also been moved to `pkg/composer`.

Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2024-12-02 13:08:43 -08:00
fahed dorgaa 1f81225336
Merge pull request #3673 from ningmingxiao/nerd_ps
fix nerdctl ps slow on  heavy IO system by using goroutine
2024-12-02 21:06:39 +01:00
Akihiro Suda 47f31ff2c1
Merge pull request #3713 from AkihiroSuda/dev
update CNI plugins (1.6.1)
2024-12-03 04:55:09 +09:00
Akihiro Suda ca1629ee73
Merge pull request #3711 from AkihiroSuda/dev
update BuildKit (0.18.0), stargz-snapshotter (0.16.2)
2024-12-02 23:31:11 +09:00
fahed dorgaa cc0600ad50
Merge pull request #3710 from AkihiroSuda/prepare-2.0.1
docs: the next release will be v2.0.1, not v2.1.0
2024-12-02 15:20:04 +01:00
Akihiro Suda 0076390906
update CNI plugins (1.6.1)
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2024-12-02 22:20:17 +09:00
Akihiro Suda 09039a18fb
update stargz-snapshotter (0.16.2)
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2024-12-02 19:22:11 +09:00
Akihiro Suda 70679d49c5
update BuildKit (0.18.0)
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2024-12-02 19:20:32 +09:00
Akihiro Suda 4a21ba7dbc
docs: the next release will be v2.0.1, not v2.1.0
ref: issue 3709

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2024-12-02 19:10:14 +09:00
Akihiro Suda 6e4afb48c2
Merge pull request #3708 from apostasie/fix-permission
Fix permissions for resolv.conf and hosts
2024-12-02 18:01:55 +09:00
apostasie 442b01d2e2
Fix permissions for resolv.conf and hosts
WriteFile uses syscall.Open, so permissions are modified by umask, if set.
For people using agressive umasks (0077), /etc/resolv.conf will end-up unreadable for non root processes.

See https://github.com/containerd/nerdctl/issues/3704

Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2024-12-01 23:36:07 -08:00
fahed dorgaa 3c41efe581
Merge pull request #3667 from haytok/issue_3486
add fields such as CONTAINER_NAME to journald log entries sent to by containers
2024-11-29 11:57:32 +01:00
Jin Dong 1dd11e1c00
Merge pull request #3699 from containerd/dependabot/go_modules/stargz-544f2939e1
build(deps): bump the stargz group with 3 updates
2024-11-27 18:53:15 -05:00
dependabot[bot] dcaee10674
build(deps): bump the stargz group with 3 updates
Bumps the stargz group with 3 updates: [github.com/containerd/stargz-snapshotter](https://github.com/containerd/stargz-snapshotter), [github.com/containerd/stargz-snapshotter/estargz](https://github.com/containerd/stargz-snapshotter) and [github.com/containerd/stargz-snapshotter/ipfs](https://github.com/containerd/stargz-snapshotter).


Updates `github.com/containerd/stargz-snapshotter` from 0.16.1 to 0.16.2
- [Release notes](https://github.com/containerd/stargz-snapshotter/releases)
- [Commits](https://github.com/containerd/stargz-snapshotter/compare/v0.16.1...v0.16.2)

Updates `github.com/containerd/stargz-snapshotter/estargz` from 0.16.1 to 0.16.2
- [Release notes](https://github.com/containerd/stargz-snapshotter/releases)
- [Commits](https://github.com/containerd/stargz-snapshotter/compare/v0.16.1...v0.16.2)

Updates `github.com/containerd/stargz-snapshotter/ipfs` from 0.16.1 to 0.16.2
- [Release notes](https://github.com/containerd/stargz-snapshotter/releases)
- [Commits](https://github.com/containerd/stargz-snapshotter/compare/v0.16.1...v0.16.2)

---
updated-dependencies:
- dependency-name: github.com/containerd/stargz-snapshotter
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: stargz
- dependency-name: github.com/containerd/stargz-snapshotter/estargz
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: stargz
- dependency-name: github.com/containerd/stargz-snapshotter/ipfs
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: stargz
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-11-27 22:15:55 +00:00
Jin Dong 400d4c399a
Merge pull request #3695 from containerd/dependabot/github_actions/docker/build-push-action-6.10.0
build(deps): bump docker/build-push-action from 6.9.0 to 6.10.0
2024-11-27 17:14:37 -05:00
Jin Dong 840193d09f
Merge pull request #3696 from containerd/dependabot/go_modules/github.com/containerd/nydus-snapshotter-0.15.0-rc.0
build(deps): bump github.com/containerd/nydus-snapshotter from 0.14.1-0.20240806063146-8fa319bfe9c5 to 0.15.0-rc.0
2024-11-27 16:35:47 -05:00
dependabot[bot] eac99f872a
build(deps): bump github.com/containerd/nydus-snapshotter
Bumps [github.com/containerd/nydus-snapshotter](https://github.com/containerd/nydus-snapshotter) from 0.14.1-0.20240806063146-8fa319bfe9c5 to 0.15.0-rc.0.
- [Release notes](https://github.com/containerd/nydus-snapshotter/releases)
- [Commits](https://github.com/containerd/nydus-snapshotter/commits/v0.15.0-rc.0)

---
updated-dependencies:
- dependency-name: github.com/containerd/nydus-snapshotter
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-11-26 22:19:39 +00:00
dependabot[bot] 159e039148
build(deps): bump docker/build-push-action from 6.9.0 to 6.10.0
Bumps [docker/build-push-action](https://github.com/docker/build-push-action) from 6.9.0 to 6.10.0.
- [Release notes](https://github.com/docker/build-push-action/releases)
- [Commits](https://github.com/docker/build-push-action/compare/v6.9.0...v6.10.0)

---
updated-dependencies:
- dependency-name: docker/build-push-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-11-26 22:17:16 +00:00
Nadeshiko Manju 43b613322c
Merge pull request #3693 from ErikJiang/fix_lint_issue
fix redundant error checks and comment format
2024-11-26 21:07:30 +08:00
bo.jiang 2ad3f57cb5 fix redundant error checks and comment format
Signed-off-by: bo.jiang <bo.jiang@daocloud.io>
2024-11-26 15:56:43 +08:00
Hayato Kiwata b060ead7b7 fix: add fields such as CONTAINER_NAME to journald log entries sent to by containers
In the current implementation, containers running by `nerdctl` dose not
export entries containing fields such as `CONTAINER_NAME`, `IMAGE_NAME`
, and etc to the journald log like containers running by `docker cli`.

At this time, the journald log entry describes below when sending to the
journald log using nerdctl.

```
> nerdctl run -d --name nginx-nerdctl --log-driver=journald nginx
bb7df47d27fd73426cec286ed88c5abf1443e74df637e2440d2dbca7229a84dc

> nerdctl ps
CONTAINER ID    IMAGE                             COMMAND                   CREATED          STATUS    PORTS    NAMES
bb7df47d27fd    docker.io/library/nginx:latest    "/docker-entrypoint.…"    3 seconds ago    Up                 nginx-nerdctl

> sudo journalctl SYSLOG_IDENTIFIER=bb7df47d27fd -a -n 1 -o json-pretty
{
        "__CURSOR" : "???",
        "__REALTIME_TIMESTAMP" : "1730899940827182",
        "__MONOTONIC_TIMESTAMP" : "10815937979908",
        "_BOOT_ID" : "???",
        "_UID" : "0",
        "_GID" : "0",
        "_CAP_EFFECTIVE" : "1ffffffffff",
        "_MACHINE_ID" : "???",
        "_HOSTNAME" : "???.us-west-2.amazon.com",
        "_TRANSPORT" : "journal",
        "_SYSTEMD_SLICE" : "system.slice",
        "PRIORITY" : "3",
        "_SYSTEMD_CGROUP" : "/system.slice/containerd.service",
        "_SYSTEMD_UNIT" : "containerd.service",
        "_COMM" : "nerdctl",
        "_EXE" : "/usr/local/bin/nerdctl",
        "_CMDLINE" : "/usr/local/bin/nerdctl _NERDCTL_INTERNAL_LOGGING /var/lib/nerdctl/1935db59",
        "SYSLOG_IDENTIFIER" : "bb7df47d27fd",
        "_PID" : "8118",
        "MESSAGE" : "2024/11/06 13:32:20 [notice] 1#1: start worker process 44",
        "_SOURCE_REALTIME_TIMESTAMP" : "1730899940825905"
}
```

On the other hand, the output fields are listed below when we use the
journald logging driver with docker cli.

- https://docs.docker.com/engine/logging/drivers/journald/

As you can see, some entries are not output by nerdctl and are
incompatible with the docker cli.

This feature request is reported in the following:

- https://github.com/containerd/nerdctl/issues/3486

Therefore, in this pull request, we will add the fields to be output in
the journald log.

After applying this fix, the journald log will output the following
fields.

```
{
  "__CURSOR": "???",
  "__REALTIME_TIMESTAMP": "1731385591671422",
  "__MONOTONIC_TIMESTAMP": "11301588824148",
  "_BOOT_ID": "???",
  "_MACHINE_ID": "???",
  "_HOSTNAME": "???.us-west-2.amazon.com",
  "PRIORITY": "3",
  "_TRANSPORT": "journal",
  "_UID": "0",
  "_GID": "0",
  "_COMM": "nerdctl",
  "_EXE": "/usr/local/bin/nerdctl",
  "_CMDLINE": "/usr/local/bin/nerdctl _NERDCTL_INTERNAL_LOGGING /var/lib/nerdctl/1935db59",
  "_CAP_EFFECTIVE": "1ffffffffff",
  "_SYSTEMD_CGROUP": "/system.slice/containerd.service",
  "_SYSTEMD_UNIT": "containerd.service",
  "_SYSTEMD_SLICE": "system.slice",
  "CONTAINER_NAME": "nginx-nerdctl",
  "IMAGE_NAME": "nginx",
  "CONTAINER_ID_FULL": "fe22eccbd704ba799785999079ac465ed067d5914e9e3f1020e769921d5a83c5",
  "SYSLOG_IDENTIFIER": "fe22eccbd704",
  "CONTAINER_TAG": "fe22eccbd704",
  "CONTAINER_ID": "fe22eccbd704",
  "_PID": "31643",
  "MESSAGE": "2024/11/12 04:26:31 [notice] 1#1: start worker process 44",
  "_SOURCE_REALTIME_TIMESTAMP": "1731385591669765"
}
```

Signed-off-by: Hayato Kiwata <haytok@amazon.co.jp>
2024-11-26 04:58:36 +00:00
Jin Dong 14277619f4
Merge pull request #3692 from containerd/dependabot/go_modules/github.com/compose-spec/compose-go/v2-2.4.5
build(deps): bump github.com/compose-spec/compose-go/v2 from 2.4.4 to 2.4.5
2024-11-25 19:25:11 -05:00
dependabot[bot] 232b6adcb7
build(deps): bump github.com/compose-spec/compose-go/v2
Bumps [github.com/compose-spec/compose-go/v2](https://github.com/compose-spec/compose-go) from 2.4.4 to 2.4.5.
- [Release notes](https://github.com/compose-spec/compose-go/releases)
- [Commits](https://github.com/compose-spec/compose-go/compare/v2.4.4...v2.4.5)

---
updated-dependencies:
- dependency-name: github.com/compose-spec/compose-go/v2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-11-25 22:37:37 +00:00
Jin Dong 9ece9beffe
Merge pull request #3689 from austinvazquez/update-containerd-v1.7.24
Update containerd (1.7.24) in CI
2024-11-22 20:54:28 -05:00
Jin Dong 2ec8290025
Merge pull request #3688 from containerd/dependabot/go_modules/github.com/containerd/cgroups/v3-3.0.4
build(deps): bump github.com/containerd/cgroups/v3 from 3.0.3 to 3.0.4
2024-11-22 16:00:56 -05:00
ningmingxiao 788fc0c298 fix nerdctl ps slow on heavy IO system by using goroutine
Signed-off-by: ningmingxiao <ning.mingxiao@zte.com.cn>
2024-11-22 17:41:52 +08:00
Austin Vazquez 0e8abacc37
Update containerd (1.7.24) in CI
Signed-off-by: Austin Vazquez <macedonv@amazon.com>
2024-11-21 22:51:14 +00:00
dependabot[bot] ba72ac7b97
build(deps): bump github.com/containerd/cgroups/v3 from 3.0.3 to 3.0.4
Bumps [github.com/containerd/cgroups/v3](https://github.com/containerd/cgroups) from 3.0.3 to 3.0.4.
- [Release notes](https://github.com/containerd/cgroups/releases)
- [Commits](https://github.com/containerd/cgroups/compare/v3.0.3...v3.0.4)

---
updated-dependencies:
- dependency-name: github.com/containerd/cgroups/v3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-11-21 22:42:03 +00:00
Akihiro Suda 6ff09eb90f
Merge pull request #3680 from yankay/update-runc2
update runc (1.2.2), BuildKit (0.17.1), stargz-snapshotter (0.16.1)
2024-11-20 11:06:30 +09:00
Hayato Kiwata f128aac0c1 fix: refactor pkg/infoutil in order to resolve import cycle
This pull request will add the fields such as `CONTAINER_NAME` and
`IMAGE_NAME` to the journald log entries sent by containers when
`nerdctl run` is run with `--log-driver=journald`.

However, the following `import cycle not allowed` error occurs when trying
to import `containerutil package` in `logging package` in the
implementation to be changed in this pull request.

```
> make
CGO_ENABLED=0 GOOS=linux go -C /local/home/haytok/workspace/nerdctl build -ldflags "-s -w  -X github.com/containerd/nerdctl/v2/pkg/version.Version=0d7dc8ec.m -X github.com/containerd/nerdctl/v2/pkg/version.Revision=0d7dc8ec4cda815acfca165b0281e801c4c5ef6e.m"   -o /local/home/haytok/workspace/nerdctl/_output/nerdctl ./cmd/nerdctl
package github.com/containerd/nerdctl/v2/cmd/nerdctl
...
	imports github.com/containerd/nerdctl/v2/pkg/infoutil: import cycle not allowed
make: *** [nerdctl] Error 1
```

Therefore, this commit refactors `infoutil package` to avoid
`import cycle not allowd` error in the next commit.

Signed-off-by: Hayato Kiwata <haytok@amazon.co.jp>
2024-11-20 01:49:50 +00:00
Kay Yan 1cbc1203bc
update stargz-snapshotter (0.16.1)
Signed-off-by: Kay Yan <kay.yan@daocloud.io>
2024-11-20 01:36:51 +00:00
Akihiro Suda db20fec9cd
Merge pull request #3683 from ryfow/fix-compose-device-run-args-2
Pass appropriate --device arguments from compose to run
2024-11-20 09:26:34 +09:00
Akihiro Suda c0ac988228
Merge pull request #3684 from containerd/dependabot/github_actions/docker/metadata-action-5.6.1
build(deps): bump docker/metadata-action from 5.5.1 to 5.6.1
2024-11-20 09:26:13 +09:00
Akihiro Suda e0d03d75fb
Merge pull request #3685 from containerd/dependabot/go_modules/github.com/Masterminds/semver/v3-3.3.1
build(deps): bump github.com/Masterminds/semver/v3 from 3.3.0 to 3.3.1
2024-11-20 08:36:38 +09:00
dependabot[bot] f572d40f62
build(deps): bump github.com/Masterminds/semver/v3 from 3.3.0 to 3.3.1
Bumps [github.com/Masterminds/semver/v3](https://github.com/Masterminds/semver) from 3.3.0 to 3.3.1.
- [Release notes](https://github.com/Masterminds/semver/releases)
- [Changelog](https://github.com/Masterminds/semver/blob/master/CHANGELOG.md)
- [Commits](https://github.com/Masterminds/semver/compare/v3.3.0...v3.3.1)

---
updated-dependencies:
- dependency-name: github.com/Masterminds/semver/v3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-11-19 22:55:59 +00:00
dependabot[bot] 3b3c68c1b4
build(deps): bump docker/metadata-action from 5.5.1 to 5.6.1
Bumps [docker/metadata-action](https://github.com/docker/metadata-action) from 5.5.1 to 5.6.1.
- [Release notes](https://github.com/docker/metadata-action/releases)
- [Commits](https://github.com/docker/metadata-action/compare/v5.5.1...v5.6.1)

---
updated-dependencies:
- dependency-name: docker/metadata-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-11-19 22:40:37 +00:00
Ryan Fowler c41cc9d928 Pass appropriate --device arguments from compose to run
This was passing a stringified version of the DeviceMapping struct
instead of a source:target:permissions string.

Signed-off-by: Ryan Fowler <ryan.fowler@singlewire.com>
2024-11-19 15:02:40 -07:00
Kay Yan 2463f8b66a
update BuildKit (0.17.1)
Signed-off-by: Kay Yan <kay.yan@daocloud.io>
2024-11-19 07:58:56 +00:00
Akihiro Suda 370b691637
Merge pull request #3670 from coderbirju/update-json-logger
fix: default json-file log size to 100MB
2024-11-19 13:47:10 +09:00
Kay Yan 37df93d316
update runc (1.2.2)
Signed-off-by: Kay Yan <kay.yan@daocloud.io>
2024-11-19 03:26:25 +00:00
Arjun Raja Yogidas 1fdb4b0ae3 fix: default json-file log size to 100MB
Signed-off-by: Arjun Raja Yogidas <arjunry@amazon.com>
2024-11-19 01:22:03 +00:00
Akihiro Suda 1cfbf4f2f3
Merge pull request #3679 from djdongjin/upgrade-stargz
Upgrade stargz
2024-11-19 07:31:47 +09:00
dependabot[bot] ae50153a1f build(deps): bump the stargz group across 1 directory with 3 updates
Bumps the stargz group with 2 updates in the / directory: [github.com/containerd/stargz-snapshotter](https://github.com/containerd/stargz-snapshotter) and [github.com/containerd/stargz-snapshotter/ipfs](https://github.com/containerd/stargz-snapshotter).

Updates `github.com/containerd/stargz-snapshotter` from 0.15.2-0.20240709063920-1dac5ef89319 to 0.16.1
- [Release notes](https://github.com/containerd/stargz-snapshotter/releases)
- [Commits](https://github.com/containerd/stargz-snapshotter/commits/v0.16.1)

Updates `github.com/containerd/stargz-snapshotter/estargz` from 0.15.2-0.20240709063920-1dac5ef89319 to 0.16.1
- [Release notes](https://github.com/containerd/stargz-snapshotter/releases)
- [Commits](https://github.com/containerd/stargz-snapshotter/commits/v0.16.1)

Updates `github.com/containerd/stargz-snapshotter/ipfs` from 0.15.2-0.20240709063920-1dac5ef89319 to 0.16.1
- [Release notes](https://github.com/containerd/stargz-snapshotter/releases)
- [Commits](https://github.com/containerd/stargz-snapshotter/commits/v0.16.1)

---
updated-dependencies:
- dependency-name: github.com/containerd/stargz-snapshotter
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: stargz
- dependency-name: github.com/containerd/stargz-snapshotter/estargz
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: stargz
- dependency-name: github.com/containerd/stargz-snapshotter/ipfs
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: stargz
...

Signed-off-by: dependabot[bot] <support@github.com>

fix CI

Signed-off-by: Jin Dong <djdongjin95@gmail.com>
2024-11-18 19:19:22 +00:00
Jin Dong 4d945c1881
Merge pull request #3675 from containerd/dependabot/go_modules/github.com/containerd/continuity-0.4.5
build(deps): bump github.com/containerd/continuity from 0.4.4 to 0.4.5
2024-11-17 16:33:46 -05:00
dependabot[bot] 32de57ba7a
build(deps): bump github.com/containerd/continuity from 0.4.4 to 0.4.5
Bumps [github.com/containerd/continuity](https://github.com/containerd/continuity) from 0.4.4 to 0.4.5.
- [Release notes](https://github.com/containerd/continuity/releases)
- [Commits](https://github.com/containerd/continuity/compare/v0.4.4...v0.4.5)

---
updated-dependencies:
- dependency-name: github.com/containerd/continuity
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-11-14 22:34:57 +00:00
Nadeshiko Manju 966c25fd53
Merge pull request #3665 from pinglanlu/main
refactor: Use a more direct and less error-prone return value
2024-11-14 20:22:48 +08:00
Manjusaka fe217ab7fe
Merge branch 'main' into pinglanlu/main 2024-11-14 18:19:16 +08:00
Nadeshiko Manju 7a0b958f73
Merge pull request #3666 from Zheaoli/manjusaka/fix-golang-lint-error
refactor: Fix golanglint action error
2024-11-14 02:47:41 +08:00
Manjusaka 7dce7c7894
refactor: Fix golanglint action error
Signed-off-by: Manjusaka <me@manjusaka.me>
2024-11-12 21:05:13 +08:00
pinglanlu 9c3513833b Use a more direct and less error-prone return value
Signed-off-by: pinglanlu <pinglanlu@outlook.com>
2024-11-12 14:30:05 +08:00
Jin Dong 8b814ca7fe
Merge pull request #3662 from containerd/dependabot/go_modules/golang-x-8da5db452c
build(deps): bump the golang-x group with 2 updates
2024-11-09 13:45:54 -05:00
dependabot[bot] 130397dd98
build(deps): bump the golang-x group with 2 updates
Bumps the golang-x group with 2 updates: [golang.org/x/crypto](https://github.com/golang/crypto) and [golang.org/x/net](https://github.com/golang/net).


Updates `golang.org/x/crypto` from 0.28.0 to 0.29.0
- [Commits](https://github.com/golang/crypto/compare/v0.28.0...v0.29.0)

Updates `golang.org/x/net` from 0.30.0 to 0.31.0
- [Commits](https://github.com/golang/net/compare/v0.30.0...v0.31.0)

---
updated-dependencies:
- dependency-name: golang.org/x/crypto
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: golang-x
- dependency-name: golang.org/x/net
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: golang-x
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-11-08 22:23:14 +00:00
Akihiro Suda 9f27e77378
Merge pull request #3660 from containerd/dependabot/go_modules/github.com/containerd/typeurl/v2-2.2.3
build(deps): bump github.com/containerd/typeurl/v2 from 2.2.2 to 2.2.3
2024-11-08 11:17:22 +09:00
Akihiro Suda 74355cf4ef
Merge pull request #3640 from swagatbora90/add-custom-bridge-ip
feat: adds IP address configuration for default bridge network
2024-11-08 11:10:25 +09:00
Akihiro Suda bcc7d42846
Merge pull request #3659 from containerd/dependabot/go_modules/github.com/compose-spec/compose-go/v2-2.4.4
build(deps): bump github.com/compose-spec/compose-go/v2 from 2.4.3 to 2.4.4
2024-11-08 11:08:58 +09:00
Akihiro Suda 8f9864acc5
Merge pull request #3658 from containerd/dependabot/go_modules/golang-x-a9080a4f9a
build(deps): bump the golang-x group with 4 updates
2024-11-08 11:06:30 +09:00
dependabot[bot] d1ea2d7b6d
build(deps): bump github.com/containerd/typeurl/v2 from 2.2.2 to 2.2.3
Bumps [github.com/containerd/typeurl/v2](https://github.com/containerd/typeurl) from 2.2.2 to 2.2.3.
- [Release notes](https://github.com/containerd/typeurl/releases)
- [Commits](https://github.com/containerd/typeurl/compare/v2.2.2...v2.2.3)

---
updated-dependencies:
- dependency-name: github.com/containerd/typeurl/v2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-11-07 22:49:55 +00:00
dependabot[bot] a82ae7bb22
build(deps): bump github.com/compose-spec/compose-go/v2
Bumps [github.com/compose-spec/compose-go/v2](https://github.com/compose-spec/compose-go) from 2.4.3 to 2.4.4.
- [Release notes](https://github.com/compose-spec/compose-go/releases)
- [Commits](https://github.com/compose-spec/compose-go/compare/v2.4.3...v2.4.4)

---
updated-dependencies:
- dependency-name: github.com/compose-spec/compose-go/v2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-11-07 22:49:49 +00:00
dependabot[bot] b5a117317a
build(deps): bump the golang-x group with 4 updates
Bumps the golang-x group with 4 updates: [golang.org/x/sync](https://github.com/golang/sync), [golang.org/x/sys](https://github.com/golang/sys), [golang.org/x/term](https://github.com/golang/term) and [golang.org/x/text](https://github.com/golang/text).


Updates `golang.org/x/sync` from 0.8.0 to 0.9.0
- [Commits](https://github.com/golang/sync/compare/v0.8.0...v0.9.0)

Updates `golang.org/x/sys` from 0.26.0 to 0.27.0
- [Commits](https://github.com/golang/sys/compare/v0.26.0...v0.27.0)

Updates `golang.org/x/term` from 0.25.0 to 0.26.0
- [Commits](https://github.com/golang/term/compare/v0.25.0...v0.26.0)

Updates `golang.org/x/text` from 0.19.0 to 0.20.0
- [Release notes](https://github.com/golang/text/releases)
- [Commits](https://github.com/golang/text/compare/v0.19.0...v0.20.0)

---
updated-dependencies:
- dependency-name: golang.org/x/sync
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: golang-x
- dependency-name: golang.org/x/sys
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: golang-x
- dependency-name: golang.org/x/term
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: golang-x
- dependency-name: golang.org/x/text
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: golang-x
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-11-07 22:49:36 +00:00
Swagat Bora 7d116bf1fd feat: configure custom IP for default bridge network
Signed-off-by: Swagat Bora <swagatbora90@gmail.com>
2024-11-07 20:54:03 +00:00
Akihiro Suda 4a562dc8c6
Merge pull request #3653 from containerd/dependabot/go_modules/github.com/vishvananda/netns-0.0.5
build(deps): bump github.com/vishvananda/netns from 0.0.4 to 0.0.5
2024-11-08 05:22:59 +09:00
Akihiro Suda 87aff5b985
Merge pull request #3654 from qiaohao9/main
typo: remove extra spaces at the lead #3650 #3651
2024-11-07 14:06:09 +09:00
dependabot[bot] d30f66e190
build(deps): bump github.com/vishvananda/netns from 0.0.4 to 0.0.5
Bumps [github.com/vishvananda/netns](https://github.com/vishvananda/netns) from 0.0.4 to 0.0.5.
- [Release notes](https://github.com/vishvananda/netns/releases)
- [Commits](https://github.com/vishvananda/netns/compare/v0.0.4...v0.0.5)

---
updated-dependencies:
- dependency-name: github.com/vishvananda/netns
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-11-07 05:06:01 +00:00
Akihiro Suda 561334f8ba
Merge pull request #3655 from AkihiroSuda/fix-3652
Mark `nerdctl builder debug` as incompatible with Docker
2024-11-07 14:05:12 +09:00
Akihiro Suda 6f2e032641
Mark `nerdctl builder debug` as incompatible with Docker
Close issue 3652

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2024-11-07 11:49:32 +09:00
qiaohao 417b61703b typo: remove extra spaces at the lead #3650 #3651
Signed-off-by: qiaohao <qiaohao.peng@outlook.com>
2024-11-07 08:49:26 +08:00
fahed dorgaa 0d7dc8ec4c
Merge pull request #3651 from qiaohao9/main
typo: remove extra colons and whitespaces #3650
2024-11-06 15:11:07 +01:00
qiaohao 7e89bd3df9 typo: remove extra colons and whitespaces #3650
Signed-off-by: qiaohao <qiaohao.peng@outlook.com>
2024-11-06 16:51:54 +08:00
Akihiro Suda af229a6731
Merge pull request #3649 from xyz-li/main
[fix] avoid escaping '<', '>', '&'
2024-11-06 16:22:40 +09:00
xyz-li 84cea6590d [fix] avoid escaping '<', '>', '&'
json.Encode will escase characters like '<', '>', '&'

Signed-off-by: xyz-li <hui0787411@163.com>
2024-11-06 11:13:13 +08:00
Akihiro Suda ef588dafa0
Merge pull request #3646 from AkihiroSuda/dev
update containerd (2.0.0), runc (1.2.1), BuildKit (0.17.0), etc.
2024-11-06 09:29:42 +09:00
Akihiro Suda 7103b54b2f
update SOCI snapshotter (0.8.0)
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2024-11-06 08:33:43 +09:00
Akihiro Suda 29f3ff6365
update containerd-fuse-overlayfs (2.0.0)
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2024-11-06 08:32:51 +09:00
Akihiro Suda 2380710b3b
update BuildKit (0.17.0)
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2024-11-06 08:29:52 +09:00
Akihiro Suda 4f64af98db
update runc (1.2.1)
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2024-11-06 08:28:00 +09:00
Akihiro Suda 75be32df7e
update containerd (2.0.0)
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2024-11-06 08:27:23 +09:00
Akihiro Suda b9e9d0aec2
Merge pull request #3644 from containerd/dependabot/go_modules/github.com/containerd/containerd/v2-2.0.0
build(deps): bump github.com/containerd/containerd/v2 from 2.0.0-rc.6 to 2.0.0
2024-11-06 06:58:12 +09:00
dependabot[bot] ccbaf82a70
build(deps): bump github.com/containerd/containerd/v2
Bumps [github.com/containerd/containerd/v2](https://github.com/containerd/containerd) from 2.0.0-rc.6 to 2.0.0.
- [Release notes](https://github.com/containerd/containerd/releases)
- [Changelog](https://github.com/containerd/containerd/blob/main/RELEASES.md)
- [Commits](https://github.com/containerd/containerd/compare/v2.0.0-rc.6...v2.0.0)

---
updated-dependencies:
- dependency-name: github.com/containerd/containerd/v2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-11-05 21:22:48 +00:00
Akihiro Suda c687471147
Merge pull request #3645 from containerd/dependabot/go_modules/github.com/containerd/typeurl/v2-2.2.2
build(deps): bump github.com/containerd/typeurl/v2 from 2.2.1 to 2.2.2
2024-11-06 06:21:57 +09:00
Akihiro Suda e6e47df1d6
Merge pull request #3614 from haytok/issue_3568
fix: not to be deleted a container created with --rm when detaching
2024-11-06 06:10:50 +09:00
dependabot[bot] b006beb55e
build(deps): bump github.com/containerd/typeurl/v2 from 2.2.1 to 2.2.2
Bumps [github.com/containerd/typeurl/v2](https://github.com/containerd/typeurl) from 2.2.1 to 2.2.2.
- [Release notes](https://github.com/containerd/typeurl/releases)
- [Commits](https://github.com/containerd/typeurl/compare/v2.2.1...v2.2.2)

---
updated-dependencies:
- dependency-name: github.com/containerd/typeurl/v2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-11-05 20:43:23 +00:00
Akihiro Suda 9bd0ab9f7e
Merge pull request #3633 from coderbirju/add-none-logger
add 'none' logger
2024-11-05 20:20:19 +09:00
Akihiro Suda b34e09023c
Merge pull request #3641 from containerd/dependabot/go_modules/containerd-7c550e2598
build(deps): bump github.com/containerd/containerd/api from 1.8.0-rc.4 to 1.8.0 in the containerd group
2024-11-05 20:00:18 +09:00
dependabot[bot] 8ea1d0ac9e
build(deps): bump github.com/containerd/containerd/api
Bumps the containerd group with 1 update: [github.com/containerd/containerd/api](https://github.com/containerd/containerd).


Updates `github.com/containerd/containerd/api` from 1.8.0-rc.4 to 1.8.0
- [Release notes](https://github.com/containerd/containerd/releases)
- [Changelog](https://github.com/containerd/containerd/blob/main/RELEASES.md)
- [Commits](https://github.com/containerd/containerd/compare/api/v1.8.0-rc.4...api/v1.8.0)

---
updated-dependencies:
- dependency-name: github.com/containerd/containerd/api
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: containerd
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-11-05 01:32:49 +00:00
Akihiro Suda 2443adac4a
Merge pull request #3643 from containerd/dependabot/github_actions/actions/checkout-4.2.2
build(deps): bump actions/checkout from 4.2.1 to 4.2.2
2024-11-05 10:32:28 +09:00
Akihiro Suda e80aaf1b6f
Merge pull request #3642 from containerd/dependabot/go_modules/github.com/containerd/errdefs-1.0.0
build(deps): bump github.com/containerd/errdefs from 0.3.0 to 1.0.0
2024-11-05 10:31:34 +09:00
dependabot[bot] 68bd32d7ac
build(deps): bump actions/checkout from 4.2.1 to 4.2.2
Bumps [actions/checkout](https://github.com/actions/checkout) from 4.2.1 to 4.2.2.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v4.2.1...v4.2.2)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-11-04 22:43:41 +00:00
dependabot[bot] 83088ef88f
build(deps): bump github.com/containerd/errdefs from 0.3.0 to 1.0.0
Bumps [github.com/containerd/errdefs](https://github.com/containerd/errdefs) from 0.3.0 to 1.0.0.
- [Release notes](https://github.com/containerd/errdefs/releases)
- [Commits](https://github.com/containerd/errdefs/compare/v0.3.0...v1.0.0)

---
updated-dependencies:
- dependency-name: github.com/containerd/errdefs
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-11-04 22:10:43 +00:00
Arjun Raja Yogidas c607537eb7 add 'none' logger
Signed-off-by: Arjun Raja Yogidas <arjunry@amazon.com>
2024-11-04 18:51:00 +00:00
Hayato Kiwata 718e7cd2bc
fix: not to be deleted a container created with --rm when detaching
In the current implementation, detaching from a container started with
`nerdctl run --rm ...` unexpectedly removes it.

The behaviour before this modification is as follows.

```
> nerdctl run --rm -it --detach-keys=ctrl-a,ctrl-b --name test alpine
/ # INFO[0002] read detach keys

> nerdctl ps
CONTAINER ID    IMAGE    COMMAND    CREATED    STATUS    PORTS    NAMES
```

When the same operation is performed in the Docker CLI, the container will
not be deleted.

This issue is reported in the following:

- https://github.com/containerd/nerdctl/issues/3568

Therefore, this commit resolves this behaviour of a container not being
deleted on detachment.

Note that the behaviour after this modification is as follows.

```
> nerdctl run --rm -it --detach-keys=ctrl-a,ctrl-b --name test alpine
/ # INFO[0010] read detach keys

> nerdctl ps
CONTAINER ID    IMAGE                                        COMMAND      CREATED           STATUS    PORTS    NAMES
46f4c829e5cc    docker.io/library/alpine:latest              "/bin/sh"    15 seconds ago    Up                 test
```

This PR has also been modified to remove a container when detaching and
attaching a container started with the --rm option.
The detailed behaviour is as follows.

```
> nerdctl attach test

/ # exit

> nerdctl ps -a
CONTAINER ID    IMAGE    COMMAND    CREATED    STATUS    PORTS    NAMES

```

Signed-off-by: Hayato Kiwata <haytok@amazon.co.jp>
2024-11-04 18:48:57 +09:00
Jin Dong c71e8d90fa
Merge pull request #3602 from haytok/isssue_3454
fix: Allow to untag images associated with running or paused containe…
2024-11-03 22:49:27 -05:00
Hayato Kiwata b776706a4a
fix: Allow to untag images associated with running or paused containers by nerdctl rmi -f
In Docker, running `docker rmi -f <Image Names>` on images associated with
running or stopped containers will untag the images, leaving <none> images.

The specific behavior in Docker is as follows.

```
> docker images
REPOSITORY   TAG       IMAGE ID       CREATED       SIZE
alpine       latest    91ef0af61f39   6 weeks ago   7.8MB

> docker ps
CONTAINER ID   IMAGE     COMMAND            CREATED         STATUS         PORTS     NAMES
fe4caab5cf42   alpine    "sleep infinity"   4 minutes ago   Up 4 minutes             test

> docker rmi -f alpine
Untagged: alpine:latest
Untagged: alpine@sha256:beefdbd8a1da6d2915566fde36db9db0b524eb737fc57cd1367effd16dc0d06d

> docker images
REPOSITORY   TAG       IMAGE ID       CREATED       SIZE
<none>       <none>    91ef0af61f39   6 weeks ago   7.8MB
```

On the other hand, the same operation described above with nerdctl will
result in the following error.

```
> nerdctl rmi -f alpine
FATA[0000] 1 errors:
conflict: unable to delete alpine (cannot be forced) - image is being used by running container 59261bebc8113ca1ea102203137c32406742c2ec43ca3b108a314e9bfb4657fb
```

This befavior is reported in the following:

- https://github.com/containerd/nerdctl/issues/3454

Therefore, this commit fixes it so that `nerdctl rmi -f <Image Names>` can
be performed on images associated with running or stopped containers.

The behaviour in nerdctl after this modification is as follows.

```
> nerdctl images
REPOSITORY    TAG       IMAGE ID        CREATED          PLATFORM       SIZE       BLOB SIZE
alpine        latest    beefdbd8a1da    5 seconds ago    linux/amd64    8.458MB    3.626MB

> nerdctl ps
CONTAINER ID    IMAGE                              COMMAND             CREATED          STATUS    PORTS    NAMES
28c9db821576    docker.io/library/alpine:latest    "sleep infinity"    6 seconds ago    Up                 alpine-28c9d

> nerdctl rmi -f alpine
Untagged: docker.io/library/alpine:latest
Untagged: sha256:beefdbd8a1da6d2915566fde36db9db0b524eb737fc57cd1367effd16dc0d06d

> nerdctl images
REPOSITORY    TAG       IMAGE ID        CREATED          PLATFORM       SIZE       BLOB SIZE
<none>        <none>    beefdbd8a1da    3 seconds ago    linux/amd64    8.458MB    3.626MB
```

Signed-off-by: Hayato Kiwata <haytok@amazon.co.jp>
2024-11-04 11:42:23 +09:00
Akihiro Suda f12f7feb35
Merge pull request #3624 from apostasie/series-13
Enable more tests to run on windows
2024-11-04 09:22:32 +09:00
Akihiro Suda 2b0550fa1a
Merge pull request #3632 from apostasie/series-14b
Alpine > Common
2024-11-04 09:21:11 +09:00
Akihiro Suda 67c0e9e470
Merge pull request #3635 from containerd/dependabot/go_modules/github.com/compose-spec/compose-go/v2-2.4.3
build(deps): bump github.com/compose-spec/compose-go/v2 from 2.4.2 to 2.4.3
2024-11-04 09:15:37 +09:00
Akihiro Suda 8b67e0bbc6
Merge pull request #3634 from containerd/dependabot/go_modules/github.com/containerd/typeurl/v2-2.2.1
build(deps): bump github.com/containerd/typeurl/v2 from 2.2.0 to 2.2.1
2024-11-04 09:14:52 +09:00
apostasie dc2c7b93f7
Enable network_inspect tests to run on windows
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2024-11-02 23:03:15 +01:00
apostasie 93189e13fa
Annotate non-windows compatible image tests
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2024-11-02 22:16:21 +01:00
apostasie 4623930836
Enable issues tests to run on Windows
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2024-11-02 22:16:20 +01:00
apostasie 465b52caab
Enable image_remove tests to run on windows
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2024-11-02 22:16:18 +01:00
Kohei Tokunaga b00f8cddca
Merge pull request #3583 from apostasie/optimize-build-time
GHA cache image build dependencies
2024-11-02 17:10:13 +09:00
dependabot[bot] 4254a1fee7
build(deps): bump github.com/compose-spec/compose-go/v2
Bumps [github.com/compose-spec/compose-go/v2](https://github.com/compose-spec/compose-go) from 2.4.2 to 2.4.3.
- [Release notes](https://github.com/compose-spec/compose-go/releases)
- [Commits](https://github.com/compose-spec/compose-go/compare/v2.4.2...v2.4.3)

---
updated-dependencies:
- dependency-name: github.com/compose-spec/compose-go/v2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-11-01 22:02:35 +00:00
dependabot[bot] 58318d517b
build(deps): bump github.com/containerd/typeurl/v2 from 2.2.0 to 2.2.1
Bumps [github.com/containerd/typeurl/v2](https://github.com/containerd/typeurl) from 2.2.0 to 2.2.1.
- [Release notes](https://github.com/containerd/typeurl/releases)
- [Commits](https://github.com/containerd/typeurl/compare/v2.2.0...v2.2.1)

---
updated-dependencies:
- dependency-name: github.com/containerd/typeurl/v2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-11-01 22:02:29 +00:00
apostasie de193b3959
Enable GHA cache for image build dependencies
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2024-11-01 16:46:48 +01:00
apostasie b1e82268ad
Fix prior test-porting not aligned with description
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2024-11-01 15:49:21 +01:00
apostasie f6d36c402b
Move from AlpineImage to CommonImage to enable windows tests
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2024-11-01 15:36:51 +01:00
apostasie bfc8e0b961
Add Infinity constant to enable windows testing compat
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2024-11-01 15:31:37 +01:00
Akihiro Suda cabd5bfef2
Merge pull request #3630 from apostasie/cosmetic-tests
Cosmetic tests
2024-11-01 21:59:38 +09:00
apostasie 7b8edba600
Remove leftover workaround for fixed bug
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2024-11-01 13:20:34 +01:00
apostasie bdc00760e5
Reduce calls to data.Identifier()
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2024-11-01 13:20:01 +01:00
Akihiro Suda 5c0f90f681
Merge pull request #3615 from apostasie/series-11
Rewrite container_stats tests
2024-11-01 21:10:09 +09:00
apostasie 04ec4a3c4d
Rewrite container_stats tests
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2024-11-01 12:00:13 +01:00
Akihiro Suda 47f1a6b0af
Merge pull request #3610 from apostasie/series-8
Rewrite container remove test
2024-11-01 17:25:10 +09:00
Akihiro Suda 324c4901fd
Merge pull request #3611 from apostasie/series-9
Rewrite container prune test
2024-11-01 17:22:20 +09:00
Akihiro Suda fa15069126
Merge pull request #3619 from apostasie/series-12
Cleanup container_create tests
2024-11-01 17:21:00 +09:00
Akihiro Suda 83c640473b
Merge pull request #3608 from apostasie/series-6
Rewrite container_wait tests
2024-11-01 17:15:00 +09:00
Akihiro Suda e33707b336
Merge pull request #3626 from apostasie/fix-convert-fail-pull
Regression: fix convert unable to find image
2024-11-01 17:12:25 +09:00
Akihiro Suda bc0739d860
Merge pull request #3612 from apostasie/series-10
Rewrite container_top tests
2024-11-01 17:11:53 +09:00
Akihiro Suda ace5548cb0
Merge pull request #3627 from containerd/dependabot/go_modules/github.com/fsnotify/fsnotify-1.8.0
build(deps): bump github.com/fsnotify/fsnotify from 1.7.0 to 1.8.0
2024-11-01 17:11:29 +09:00
dependabot[bot] 5862baf739
build(deps): bump github.com/fsnotify/fsnotify from 1.7.0 to 1.8.0
Bumps [github.com/fsnotify/fsnotify](https://github.com/fsnotify/fsnotify) from 1.7.0 to 1.8.0.
- [Release notes](https://github.com/fsnotify/fsnotify/releases)
- [Changelog](https://github.com/fsnotify/fsnotify/blob/main/CHANGELOG.md)
- [Commits](https://github.com/fsnotify/fsnotify/compare/v1.7.0...v1.8.0)

---
updated-dependencies:
- dependency-name: github.com/fsnotify/fsnotify
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-10-31 22:54:19 +00:00
apostasie 75fdc4994f
Fix convert unable to find image
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2024-10-31 20:10:28 +01:00
fahed dorgaa f42d778739
Merge pull request #3609 from apostasie/series-7
Rewrite diff tests & minor ignore file tweak
2024-10-31 14:16:33 +01:00
Akihiro Suda 9821b3b1e6
Merge pull request #3620 from containerd/dependabot/go_modules/github.com/compose-spec/compose-go/v2-2.4.2
build(deps): bump github.com/compose-spec/compose-go/v2 from 2.4.1 to 2.4.2
2024-10-31 22:02:45 +09:00
apostasie 4760ee9359
Rewrite container_top tests
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2024-10-31 12:14:45 +01:00
apostasie 54196647c2
Remove fixed-bug workaround
Fixed in https://github.com/containerd/nerdctl/pull/3618

Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2024-10-31 12:14:05 +01:00
dependabot[bot] 20987449b3
build(deps): bump github.com/compose-spec/compose-go/v2
Bumps [github.com/compose-spec/compose-go/v2](https://github.com/compose-spec/compose-go) from 2.4.1 to 2.4.2.
- [Release notes](https://github.com/compose-spec/compose-go/releases)
- [Commits](https://github.com/compose-spec/compose-go/compare/v2.4.1...v2.4.2)

---
updated-dependencies:
- dependency-name: github.com/compose-spec/compose-go/v2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-10-31 00:01:23 +00:00
Akihiro Suda 2a0b9f5627
Merge pull request #3621 from containerd/dependabot/go_modules/github.com/Microsoft/hcsshim-0.12.9
build(deps): bump github.com/Microsoft/hcsshim from 0.12.8 to 0.12.9
2024-10-31 09:00:37 +09:00
dependabot[bot] 8f9eccd946
build(deps): bump github.com/Microsoft/hcsshim from 0.12.8 to 0.12.9
Bumps [github.com/Microsoft/hcsshim](https://github.com/Microsoft/hcsshim) from 0.12.8 to 0.12.9.
- [Release notes](https://github.com/Microsoft/hcsshim/releases)
- [Commits](https://github.com/Microsoft/hcsshim/compare/v0.12.8...v0.12.9)

---
updated-dependencies:
- dependency-name: github.com/Microsoft/hcsshim
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-10-30 22:41:13 +00:00
apostasie 6b3d66151d
Container create tests cleanup
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2024-10-30 21:47:58 +01:00
Akihiro Suda acbec64131
Merge pull request #3618 from apostasie/fix-leaking-test
Fix test leaking tagged Alpine image
2024-10-31 05:05:45 +09:00
Akihiro Suda ed86d37f7c
Merge pull request #3617 from apostasie/update-busybox
Update busybox image (support sleep inf)
2024-10-31 05:05:01 +09:00
apostasie 40ddd34e3a
Update busybox image (support sleep inf)
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2024-10-30 18:46:10 +01:00
apostasie 708f17257e
Fix test leaking tagged Alpine image
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2024-10-30 18:23:23 +01:00
apostasie b722721171
Rewrite container prune test
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2024-10-29 19:23:58 +01:00
apostasie 38f7440043
Rewrite container remove test
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2024-10-29 19:17:20 +01:00
apostasie 2336d3d1d0
Rewrite container diff test
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2024-10-29 19:08:29 +01:00
apostasie a5f487d484
Align gitignore and dockerignore
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2024-10-29 17:59:27 +01:00
apostasie 4d06e7305c
Rewrite container_wait tests
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
2024-10-29 17:54:28 +01:00
Akihiro Suda 49a19edd59
Merge pull request #3607 from AkihiroSuda/dev
go.mod: github.com/containerd/imgcrypt/v2 v2.0.0-rc.1
2024-10-29 09:36:36 +09:00
Akihiro Suda eddb0eb8fb
go.mod: github.com/containerd/imgcrypt/v2 v2.0.0-rc.1
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2024-10-29 09:01:44 +09:00
Akihiro Suda 20adb376b0
Merge pull request #3606 from containerd/dependabot/go_modules/github.com/compose-spec/compose-go/v2-2.4.1
build(deps): bump github.com/compose-spec/compose-go/v2 from 2.4.0 to 2.4.1
2024-10-29 08:59:48 +09:00
Akihiro Suda d3af71a203
Merge pull request #3605 from containerd/dependabot/go_modules/github.com/containerd/continuity-0.4.4
build(deps): bump github.com/containerd/continuity from 0.4.3 to 0.4.4
2024-10-29 08:59:13 +09:00
dependabot[bot] fcdd7262b3
build(deps): bump github.com/compose-spec/compose-go/v2
Bumps [github.com/compose-spec/compose-go/v2](https://github.com/compose-spec/compose-go) from 2.4.0 to 2.4.1.
- [Release notes](https://github.com/compose-spec/compose-go/releases)
- [Commits](https://github.com/compose-spec/compose-go/compare/v2.4.0...v2.4.1)

---
updated-dependencies:
- dependency-name: github.com/compose-spec/compose-go/v2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-10-28 23:01:01 +00:00
dependabot[bot] 443d504b55
build(deps): bump github.com/containerd/continuity from 0.4.3 to 0.4.4
Bumps [github.com/containerd/continuity](https://github.com/containerd/continuity) from 0.4.3 to 0.4.4.
- [Release notes](https://github.com/containerd/continuity/releases)
- [Commits](https://github.com/containerd/continuity/compare/v0.4.3...v0.4.4)

---
updated-dependencies:
- dependency-name: github.com/containerd/continuity
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-10-28 23:00:48 +00:00
Akihiro Suda b17673dc49
Merge pull request #3603 from containerd/dependabot/go_modules/github.com/compose-spec/compose-go/v2-2.4.0
build(deps): bump github.com/compose-spec/compose-go/v2 from 2.3.0 to 2.4.0
2024-10-25 10:55:17 +09:00
dependabot[bot] bb240f124d
build(deps): bump github.com/compose-spec/compose-go/v2
Bumps [github.com/compose-spec/compose-go/v2](https://github.com/compose-spec/compose-go) from 2.3.0 to 2.4.0.
- [Release notes](https://github.com/compose-spec/compose-go/releases)
- [Commits](https://github.com/compose-spec/compose-go/compare/v2.3.0...v2.4.0)

---
updated-dependencies:
- dependency-name: github.com/compose-spec/compose-go/v2
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-10-24 22:16:58 +00:00
635 changed files with 33146 additions and 11322 deletions

View File

@ -1,9 +1,10 @@
# artifacts
/nerdctl
_output
*.gomodjail
# golangci-lint
build
/build
# vagrant
/.vagrant

View File

@ -31,19 +31,20 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v4.2.2
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
# FIXME: setup-qemu-action is depended by `gomodjail pack`
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
uses: docker/setup-qemu-action@29109295f81e9208d7d86ff1c6c12d2833863392 # v3.6.0
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1
# Login against a Docker registry except on PR
# https://github.com/docker/login-action
- name: Log into registry ${{ env.REGISTRY }}
if: github.event_name != 'pull_request'
uses: docker/login-action@v3.3.0
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
@ -53,17 +54,19 @@ jobs:
# https://github.com/docker/metadata-action
- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@v5.5.1
uses: docker/metadata-action@902fa8ec7d6ecbf8d84d538b9b233a880e428804 # v5.7.0
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
# Build and push Docker image with Buildx (don't push on PR)
# https://github.com/docker/build-push-action
- name: Build and push Docker image
uses: docker/build-push-action@v6.9.0
uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0
with:
context: .
platforms: linux/amd64,linux/arm64
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
secrets: |
github_token=${{ secrets.GITHUB_TOKEN }}

110
.github/workflows/job-build.yml vendored Normal file
View File

@ -0,0 +1,110 @@
# This job just builds nerdctl for the golang versions we support (as a smoke test)
name: job-build
on:
workflow_call:
inputs:
timeout:
required: true
type: number
go-version:
required: true
type: string
runner:
required: true
type: string
canary:
required: false
default: false
type: boolean
env:
GOTOOLCHAIN: local
jobs:
build-all-targets:
name: ${{ format('go {0}', inputs.canary && 'canary' || inputs.go-version ) }}
timeout-minutes: ${{ inputs.timeout }}
runs-on: "${{ inputs.runner }}"
defaults:
run:
shell: bash
env:
GO_VERSION: ${{ inputs.go-version }}
steps:
- name: "Init: checkout"
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 1
- if: ${{ inputs.canary }}
name: "Init (canary): retrieve GO_VERSION"
run: |
. ./hack/github/action-helpers.sh
latest_go="$(. ./hack/provisioning/version/fetch.sh; go::canary::for::go-setup)"
printf "GO_VERSION=%s\n" "$latest_go" >> "$GITHUB_ENV"
[ "$latest_go" != "" ] || \
github::log::warning "No canary go" "There is currently no canary go version to test. Steps will not run."
- if: ${{ env.GO_VERSION != '' }}
name: "Init: install go"
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
with:
go-version: ${{ env.GO_VERSION }}
check-latest: true
- if: ${{ env.GO_VERSION != '' }}
name: "Run: make binaries"
run: |
. ./hack/github/action-helpers.sh
github::md::table::header "OS" "Arch" "Result" "Time" >> $GITHUB_STEP_SUMMARY
failure=
build(){
local goos="$1"
local goarch="${2:-amd64}"
local goarm="${3:-}"
local result
GOOS="$goos" GOARCH="$goarch" GOARM="$goarm" go build ./examples/...
github::timer::begin
GOOS="$goos" GOARCH="$goarch" GOARM="$goarm" make binaries \
&& result="$decorator_success" \
|| {
failure=true
result="$decorator_failure"
}
[ ! "$goarm" ] || goarch="$goarch/v$goarm"
github::md::table::line "$goos" "$goarch" "$result" "$(github::timer::format <(github::timer::tick))" >> $GITHUB_STEP_SUMMARY
}
# We officially support these
build linux
build linux arm64
build windows
build freebsd
# These architectures are not released, but we still verify that we can at least compile
build darwin
build linux arm 6
build linux loong64
build linux ppc64le
build linux riscv64
build linux s390x
[ ! "$failure" ] || exit 1
- if: ${{ env.GO_VERSION != '' }}
name: "Run: make binaries with custom BUILDTAGS"
run: |
set -eux
# no_ipfs: make sure it does not incur any IPFS-related dependency
go mod vendor
rm -rf vendor/github.com/ipfs vendor/github.com/multiformats
BUILDTAGS=no_ipfs make binaries

76
.github/workflows/job-lint-go.yml vendored Normal file
View File

@ -0,0 +1,76 @@
# This job runs golangci-lint
# Note that technically, `make lint-go-all` would run the linter for all targets, and could be called once, on a single instance.
# The point of running it on a matrix instead, each GOOS separately, is to verify that the tooling itself is working on the target OS.
name: job-lint-go
on:
workflow_call:
inputs:
timeout:
required: true
type: number
go-version:
required: true
type: string
runner:
required: true
type: string
canary:
required: false
default: false
type: boolean
goos:
required: true
type: string
env:
GOTOOLCHAIN: local
jobs:
lint-go:
name: ${{ format('{0}{1}', inputs.goos, inputs.canary && ' (go canary)' || '') }}
timeout-minutes: ${{ inputs.timeout }}
runs-on: "${{ inputs.runner }}"
defaults:
run:
shell: bash
env:
GO_VERSION: ${{ inputs.go-version }}
steps:
- name: "Init: checkout"
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 1
- if: ${{ inputs.canary }}
name: "Init (canary): retrieve GO_VERSION"
run: |
latest_go="$(. ./hack/provisioning/version/fetch.sh; go::canary::for::go-setup)"
printf "GO_VERSION=%s\n" "$latest_go" >> "$GITHUB_ENV"
[ "$latest_go" != "" ] || \
echo "::warning title=No canary go::There is currently no canary go version to test. Steps will not run."
- if: ${{ env.GO_VERSION != '' }}
name: "Init: install go"
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
with:
go-version: ${{ env.GO_VERSION }}
check-latest: true
- if: ${{ env.GO_VERSION != '' }}
name: "Init: install dev-tools"
run: |
echo "::group:: make install-dev-tools"
make install-dev-tools
echo "::endgroup::"
- if: ${{ env.GO_VERSION != '' }}
name: "Run"
run: |
# On canary, lint for all supported targets
if [ "${{ inputs.canary }}" == "true" ]; then
NO_COLOR=true make lint-go-all
else
NO_COLOR=true GOOS="${{ inputs.goos }}" make lint-go
fi

38
.github/workflows/job-lint-other.yml vendored Normal file
View File

@ -0,0 +1,38 @@
# This job runs any subsidiary linter not part of golangci (shell, yaml, etc)
name: job-lint-other
on:
workflow_call:
inputs:
timeout:
required: true
type: number
runner:
required: true
type: string
env:
GOTOOLCHAIN: local
jobs:
lint-other:
name: "yaml | shell"
timeout-minutes: ${{ inputs.timeout }}
runs-on: ${{ inputs.runner }}
defaults:
run:
shell: bash
steps:
- name: "Init: checkout"
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 1
- name: "Run: yaml"
run: |
make lint-yaml
- name: "Run: shell"
run: |
make lint-shell

56
.github/workflows/job-lint-project.yml vendored Normal file
View File

@ -0,0 +1,56 @@
# This job runs containerd shared project-checks, that verifies licenses, headers, and commits.
# To run locally, you may just use `make lint` instead, that does the same thing
# (albeit `make lint` uses more modern versions).
name: job-lint-project
on:
workflow_call:
inputs:
timeout:
required: true
type: number
go-version:
required: true
type: string
runner:
required: true
type: string
env:
GOTOOLCHAIN: local
jobs:
project:
name: "commits, licenses..."
timeout-minutes: ${{ inputs.timeout }}
runs-on: ${{ inputs.runner }}
defaults:
run:
shell: bash
steps:
- name: "Init: checkout"
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 100
path: src/github.com/containerd/nerdctl
- name: "Init: install go"
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
with:
go-version: ${{ inputs.go-version }}
check-latest: true
cache-dependency-path: src/github.com/containerd/nerdctl
- name: "Run"
uses: containerd/project-checks@d7751f3c375b8fe4a84c02a068184ee4c1f59bc4 # v1.2.2
with:
working-directory: src/github.com/containerd/nerdctl
repo-access-token: ${{ secrets.GITHUB_TOKEN }}
# go-licenses-ignore is set because go-licenses cannot detect the license of the following package:
# * go-base36: Apache-2.0 OR MIT (https://github.com/multiformats/go-base36/blob/master/LICENSE.md)
#
# The list of the CNCF-approved licenses can be found here:
# https://github.com/cncf/foundation/blob/main/allowed-third-party-license-policy.md
go-licenses-ignore: |
github.com/multiformats/go-base36

View File

@ -0,0 +1,57 @@
# This job pre-heats the cache for the test image by building all dependencies
name: job-test-dependencies
on:
workflow_call:
inputs:
timeout:
required: true
type: number
runner:
required: true
type: string
containerd-version:
required: false
default: ''
type: string
env:
GOTOOLCHAIN: local
jobs:
# This job builds the dependency target of the test docker image for all supported architectures and cache it in GHA
build-dependencies:
# Note: for whatever reason, you cannot access env.RUNNER_ARCH here
name: "${{ contains(inputs.runner, 'arm') && 'arm64' || 'amd64' }}${{ inputs.containerd-version && format(' | {0}', inputs.containerd-version) || ''}}"
timeout-minutes: ${{ inputs.timeout }}
runs-on: "${{ inputs.runner }}"
defaults:
run:
shell: bash
steps:
- name: "Init: checkout"
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 1
- name: "Init: expose GitHub Runtime variables for gha"
uses: crazy-max/ghaction-github-runtime@3cb05d89e1f492524af3d41a1c98c83bc3025124 # v3.1.0
- name: "Run: build dependencies for the integration test environment image"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
# Cache is sharded per-architecture
arch=${{ env.RUNNER_ARCH == 'ARM64' && 'arm64' || 'amd64' }}
docker buildx create --name with-gha --use
# Honor old containerd if requested
args=()
if [ "${{ inputs.containerd-version }}" != "" ]; then
args=(--build-arg CONTAINERD_VERSION=${{ inputs.containerd-version }})
fi
docker buildx build \
--secret id=github_token,env=GITHUB_TOKEN \
--cache-to type=gha,compression=zstd,mode=max,scope=test-integration-dependencies-"$arch" \
--cache-from type=gha,scope=test-integration-dependencies-"$arch" \
--target build-dependencies "${args[@]}" .

View File

@ -0,0 +1,181 @@
# This job runs integration tests inside a container, for all supported variants (ipv6, canary, etc)
# Note that it is linux and nerdctl (+/- gomodjail) only.
name: job-test-in-container
on:
workflow_call:
inputs:
timeout:
required: true
type: number
runner:
required: true
type: string
canary:
required: false
default: false
type: boolean
target:
required: false
default: ''
type: string
binary:
required: false
default: nerdctl
type: string
containerd-version:
required: false
default: ''
type: string
rootlesskit-version:
required: false
default: ''
type: string
ipv6:
required: false
default: false
type: boolean
env:
GOTOOLCHAIN: local
jobs:
test:
name: |
${{ inputs.binary != 'nerdctl' && format('{0} < ', inputs.binary) || '' }}
${{ inputs.target }}
${{ contains(inputs.runner, 'arm') && '(arm)' || '' }}
${{ contains(inputs.runner, '22.04') && '(old ubuntu)' || '' }}
${{ inputs.ipv6 && ' (ipv6)' || '' }}
${{ inputs.canary && ' (canary)' || '' }}
${{ inputs.containerd-version && format(' (ctd: {0})', inputs.containerd-version) || '' }}
${{ inputs.rootlesskit-version && format(' (rlk: {0})', inputs.rootlesskit-version) || '' }}
timeout-minutes: ${{ inputs.timeout }}
runs-on: ${{ inputs.runner }}
defaults:
run:
shell: bash
env:
# https://github.com/containerd/nerdctl/issues/622
# The only case when rootlesskit-version is force-specified is when we downgrade explicitly to v1
WORKAROUND_ISSUE_622: ${{ inputs.rootlesskit-version }}
steps:
- name: "Init: checkout"
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 1
- name: "Init: expose GitHub Runtime variables for gha"
uses: crazy-max/ghaction-github-runtime@3cb05d89e1f492524af3d41a1c98c83bc3025124 # v3.1.0
- name: "Init: register QEMU (tonistiigi/binfmt)"
run: |
# `--install all` will only install emulation for architectures that cannot be natively executed
# Since some arm64 platforms do provide native fallback execution for 32 bits,
# armv7 emulation may or may not be installed, causing variance in the result of `uname -m`.
# To avoid that, we explicitly list the architectures we do want emulation for.
docker run --privileged --rm tonistiigi/binfmt --install linux/amd64
docker run --privileged --rm tonistiigi/binfmt --install linux/arm64
docker run --privileged --rm tonistiigi/binfmt --install linux/arm/v7
- if: ${{ inputs.canary }}
name: "Init (canary): prepare updated test image"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
. ./hack/build-integration-canary.sh
canary::build::integration
- if: ${{ ! inputs.canary }}
name: "Init: prepare test image"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
buildargs=()
# If the runner is old, use old ubuntu inside the container as well
[ "${{ contains(inputs.runner, '22.04') }}" != "true" ] || buildargs=(--build-arg UBUNTU_VERSION=22.04)
# Honor if we want old containerd
[ "${{ inputs.containerd-version }}" == "" ] || buildargs+=(--build-arg CONTAINERD_VERSION=${{ inputs.containerd-version }})
# Honor custom targets and if we want old rootlesskit
target=test-integration
if [ "${{ inputs.target }}" != "rootful" ]; then
target+=-${{ inputs.target }}
if [ "${{ inputs.rootlesskit-version }}" != "" ]; then
buildargs+=(--build-arg ROOTLESSKIT_VERSION=${{ inputs.rootlesskit-version }})
fi
fi
# Cache is sharded per-architecture
arch=${{ env.RUNNER_ARCH == 'ARM64' && 'arm64' || 'amd64' }}
docker buildx create --name with-gha --use
docker buildx build \
--secret id=github_token,env=GITHUB_TOKEN \
--output=type=docker \
--cache-from type=gha,scope=test-integration-dependencies-"$arch" \
-t "$target" --target "$target" \
"${buildargs[@]}" \
.
# Rootful needs to disable snap
- if: ${{ inputs.target == 'rootful' }}
name: "Init: remove snap loopback devices (conflicts with our loopback devices in TestRunDevice)"
run: |
sudo systemctl disable --now snapd.service snapd.socket
sudo apt-get purge -qq snapd
sudo losetup -Dv
sudo losetup -lv
# Rootless on modern ubuntu wants apparmor
- if: ${{ inputs.target != 'rootful' && ! contains(inputs.runner, '22.04') }}
name: "Init: prepare apparmor for rootless + ubuntu 24+"
run: |
cat <<EOT | sudo tee "/etc/apparmor.d/usr.local.bin.rootlesskit"
abi <abi/4.0>,
include <tunables/global>
/usr/local/bin/rootlesskit flags=(unconfined) {
userns,
# Site-specific additions and overrides. See local/README for details.
include if exists <local/usr.local.bin.rootlesskit>
}
EOT
sudo systemctl restart apparmor.service
# ipv6 wants... ipv6
- if: ${{ inputs.ipv6 }}
name: "Init: ipv6"
run: |
# Enable ipv4 and ipv6 forwarding
sudo sysctl -w net.ipv6.conf.all.forwarding=1
sudo sysctl -w net.ipv4.ip_forward=1
# Enable IPv6 for Docker, and configure docker to use containerd for gha
sudo mkdir -p /etc/docker
echo '{"ipv6": true, "fixed-cidr-v6": "2001:db8:1::/64", "experimental": true, "ip6tables": true}' | sudo tee /etc/docker/daemon.json
sudo systemctl restart docker
- name: "Run: integration tests"
run: |
. ./hack/github/action-helpers.sh
github::md::h2 "non-flaky" >> "$GITHUB_STEP_SUMMARY"
# IPV6 note: nested IPv6 network inside docker and qemu is complex and needs a bunch of sysctl config.
# Therefore, it's hard to debug why the IPv6 tests fail in such an isolation layer.
# On the other side, using the host network is easier at configuration.
# Besides, each job is running on a different instance, which means using host network here
# is safe and has no side effects on others.
[ "${{ inputs.target }}" == "rootful" ] \
&& args=(test-integration ./hack/test-integration.sh -test.allow-modify-users=true) \
|| args=(test-integration-${{ inputs.target }} /test-integration-rootless.sh ./hack/test-integration.sh)
if [ "${{ inputs.ipv6 }}" == true ]; then
docker run --network host -t --rm --privileged -e GITHUB_STEP_SUMMARY="$GITHUB_STEP_SUMMARY" -v "$GITHUB_STEP_SUMMARY":"$GITHUB_STEP_SUMMARY" -e WORKAROUND_ISSUE_622=${WORKAROUND_ISSUE_622:-} "${args[@]}" -test.only-flaky=false -test.only-ipv6 -test.target=${{ inputs.binary }}
else
docker run -t --rm --privileged -e GITHUB_STEP_SUMMARY="$GITHUB_STEP_SUMMARY" -v "$GITHUB_STEP_SUMMARY":"$GITHUB_STEP_SUMMARY" -e WORKAROUND_ISSUE_622=${WORKAROUND_ISSUE_622:-} "${args[@]}" -test.only-flaky=false -test.target=${{ inputs.binary }}
fi
# FIXME: this NEEDS to go away
- name: "Run: integration tests (flaky)"
run: |
. ./hack/github/action-helpers.sh
github::md::h2 "flaky" >> "$GITHUB_STEP_SUMMARY"
[ "${{ inputs.target }}" == "rootful" ] \
&& args=(test-integration ./hack/test-integration.sh) \
|| args=(test-integration-${{ inputs.target }} /test-integration-rootless.sh ./hack/test-integration.sh)
if [ "${{ inputs.ipv6 }}" == true ]; then
docker run --network host -t --rm --privileged -e GITHUB_STEP_SUMMARY="$GITHUB_STEP_SUMMARY" -v "$GITHUB_STEP_SUMMARY":"$GITHUB_STEP_SUMMARY" -e WORKAROUND_ISSUE_622=${WORKAROUND_ISSUE_622:-} "${args[@]}" -test.only-flaky=true -test.only-ipv6 -test.target=${{ inputs.binary }}
else
docker run -t --rm --privileged -e GITHUB_STEP_SUMMARY="$GITHUB_STEP_SUMMARY" -v "$GITHUB_STEP_SUMMARY":"$GITHUB_STEP_SUMMARY" -e WORKAROUND_ISSUE_622=${WORKAROUND_ISSUE_622:-} "${args[@]}" -test.only-flaky=true -test.target=${{ inputs.binary }}
fi

210
.github/workflows/job-test-in-host.yml vendored Normal file
View File

@ -0,0 +1,210 @@
# This currently test docker and nerdctl on windows (w/o canary)
# Structure is in to allow testing nerdctl on linux as well, though more work is required to make it functional.
name: job-test-in-host
on:
workflow_call:
inputs:
timeout:
required: true
type: number
runner:
required: true
type: string
canary:
required: false
default: false
type: boolean
binary:
required: false
default: nerdctl
type: string
go-version:
required: true
type: string
docker-version:
required: true
type: string
containerd-version:
required: true
type: string
containerd-sha:
required: true
type: string
containerd-service-sha:
required: true
type: string
windows-cni-version:
required: true
type: string
linux-cni-version:
required: true
type: string
linux-cni-sha:
required: true
type: string
env:
GOTOOLCHAIN: local
jobs:
test:
name: |
${{ inputs.binary != 'nerdctl' && format('{0} < ', inputs.binary) || '' }}
${{ contains(inputs.runner, 'ubuntu') && ' linux' || ' windows' }}
${{ contains(inputs.runner, 'arm') && '(arm)' || '' }}
${{ contains(inputs.runner, '22.04') && '(old ubuntu)' || '' }}
${{ inputs.canary && ' (canary)' || '' }}
timeout-minutes: ${{ inputs.timeout }}
runs-on: "${{ inputs.runner }}"
defaults:
run:
shell: bash
env:
SHOULD_RUN: "yes"
GO_VERSION: ${{ inputs.go-version }}
# Both Docker and nerdctl on linux need rootful right now
WITH_SUDO: ${{ contains(inputs.runner, 'ubuntu') }}
CONTAINERD_VERSION: ${{ inputs.containerd-version }}
CONTAINERD_SHA: ${{ inputs.containerd-sha }}
steps:
- name: "Init: checkout"
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 1
- if: ${{ inputs.canary }}
name: "Init (canary): retrieve latest go and containerd"
run: |
latest_go="$(. ./hack/provisioning/version/fetch.sh; go::canary::for::go-setup)"
latest_containerd="$(. ./hack/provisioning/version/fetch.sh; github::project::latest "containerd/containerd")"
[ "$latest_go" == "" ] || \
printf "GO_VERSION=%s\n" "$latest_go" >> "$GITHUB_ENV"
[ "${latest_containerd:1}" == "$CONTAINERD_VERSION" ] || {
printf "CONTAINERD_VERSION=%s\n" "${latest_containerd:1}" >> "$GITHUB_ENV"
printf "CONTAINERD_SHA=canary is volatile and I accept the risk\n" >> "$GITHUB_ENV"
}
if [ "$latest_go" == "" ] && [ "${latest_containerd:1}" == "$CONTAINERD_VERSION" ]; then
echo "::warning title=No canary::There is currently no canary versions to test. Steps will not run.";
printf "SHOULD_RUN=no\n" >> "$GITHUB_ENV"
fi
- if: ${{ env.SHOULD_RUN == 'yes' }}
name: "Init: install go"
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
with:
go-version: ${{ env.GO_VERSION }}
check-latest: true
# XXX RUNNER_OS and generally env is too unreliable
# - if: ${{ env.RUNNER_OS == 'Linux' }}
- if: ${{ contains(inputs.runner, 'ubuntu') && env.SHOULD_RUN == 'yes' }}
name: "Init (linux): prepare host"
run: |
if [ "${{ contains(inputs.binary, 'docker') }}" == true ]; then
echo "::group:: configure cdi for docker"
sudo mkdir -p /etc/docker
sudo jq '.features.cdi = true' /etc/docker/daemon.json | sudo tee /etc/docker/daemon.json.tmp && sudo mv /etc/docker/daemon.json.tmp /etc/docker/daemon.json
echo "::endgroup::"
echo "::group:: downgrade docker to the specific version we want to test (${{ inputs.docker-version }})"
sudo apt-get update -qq
sudo apt-get install -qq ca-certificates curl
sudo install -m 0755 -d /etc/apt/keyrings
sudo cp ./hack/provisioning/gpg/docker /etc/apt/keyrings/docker.asc
sudo chmod a+r /etc/apt/keyrings/docker.asc
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \
$(. /etc/os-release && echo "${UBUNTU_CODENAME:-$VERSION_CODENAME}") stable" \
| sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update -qq
sudo apt-get install -qq --allow-downgrades docker-ce=${{ inputs.docker-version }} docker-ce-cli=${{ inputs.docker-version }}
echo "::endgroup::"
else
# FIXME: this is missing runc (see top level workflow note about the state of this)
echo "::group:: install dependencies"
sudo ./hack/provisioning/linux/containerd.sh uninstall
./hack/provisioning/linux/containerd.sh rootful "$CONTAINERD_VERSION" "amd64" "$CONTAINERD_SHA" "${{ inputs.containerd-service-sha }}"
sudo ./hack/provisioning/linux/cni.sh uninstall
./hack/provisioning/linux/cni.sh install "${{ inputs.linux-cni-version }}" "amd64" "${{ inputs.linux-cni-sha }}"
echo "::endgroup::"
echo "::group:: build nerctl"
go install ./cmd/nerdctl
echo "$HOME/go/bin" >> "$GITHUB_PATH"
# Since tests are going to run root, we need nerdctl to be in a PATH that will survive `sudo`
sudo cp "$(which nerdctl)" /usr/local/bin
echo "::endgroup::"
fi
# Register QEMU (tonistiigi/binfmt)
# `--install all` will only install emulation for architectures that cannot be natively executed
# Since some arm64 platforms do provide native fallback execution for 32 bits,
# armv7 emulation may or may not be installed, causing variance in the result of `uname -m`.
# To avoid that, we explicitly list the architectures we do want emulation for.
echo "::group:: install binfmt"
docker run --quiet --privileged --rm tonistiigi/binfmt --install linux/amd64
docker run --quiet --privileged --rm tonistiigi/binfmt --install linux/arm64
docker run --quiet --privileged --rm tonistiigi/binfmt --install linux/arm/v7
echo "::endgroup::"
# FIXME: remove expect when we are done removing unbuffer from tests
echo "::group:: installing test dependencies"
sudo apt-get install -qq expect
echo "::endgroup::"
- if: ${{ contains(inputs.runner, 'windows') && env.SHOULD_RUN == 'yes' }}
name: "Init (windows): prepare host"
env:
ctrdVersion: ${{ env.CONTAINERD_VERSION }}
run: |
# Install WinCNI
echo "::group:: install wincni"
GOPATH=$(go env GOPATH) WINCNI_VERSION=${{ inputs.windows-cni-version }} ./hack/provisioning/windows/cni.sh
echo "::endgroup::"
# Install containerd
echo "::group:: install containerd"
powershell hack/provisioning/windows/containerd.ps1
echo "::endgroup::"
# Install nerdctl
echo "::group:: build nerctl"
go install ./cmd/nerdctl
echo "::endgroup::"
choco install jq
- if: ${{ env.SHOULD_RUN == 'yes' }}
name: "Init: install dev tools"
run: |
echo "::group:: make install-dev-tools"
make install-dev-tools
echo "::endgroup::"
# ipv6 is tested only on linux
- if: ${{ contains(inputs.runner, 'ubuntu') && env.SHOULD_RUN == 'yes' }}
name: "Run (linux): integration tests (IPv6)"
run: |
. ./hack/github/action-helpers.sh
github::md::h2 "ipv6" >> "$GITHUB_STEP_SUMMARY"
./hack/test-integration.sh -test.target=${{ inputs.binary }} -test.only-ipv6
- if: ${{ env.SHOULD_RUN == 'yes' }}
name: "Run: integration tests"
run: |
. ./hack/github/action-helpers.sh
github::md::h2 "non-flaky" >> "$GITHUB_STEP_SUMMARY"
./hack/test-integration.sh -test.target=${{ inputs.binary }} -test.only-flaky=false
# FIXME: this must go
- if: ${{ env.SHOULD_RUN == 'yes' }}
name: "Run: integration tests (flaky)"
run: |
. ./hack/github/action-helpers.sh
github::md::h2 "flaky" >> "$GITHUB_STEP_SUMMARY"
./hack/test-integration.sh -test.target=${{ inputs.binary }} -test.only-flaky=true

121
.github/workflows/job-test-in-lima.yml vendored Normal file
View File

@ -0,0 +1,121 @@
# Currently, Lima job test only for EL, though in the future it could be used to also test FreeBSD or other linux-es
name: job-test-in-lima
on:
workflow_call:
inputs:
timeout:
required: true
type: number
runner:
required: true
type: string
target:
required: true
type: string
guest:
required: true
type: string
jobs:
test:
name: "${{ inputs.guest }} ${{ inputs.target }}"
timeout-minutes: ${{ inputs.timeout }}
runs-on: "${{ inputs.runner }}"
env:
TARGET: ${{ inputs.target }}
steps:
- name: "Init: checkout"
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 1
- name: "Init: lima"
uses: lima-vm/lima-actions/setup@03b96d61959e83b2c737e44162c3088e81de0886 # v1.0.1
id: lima-actions-setup
- name: "Init: Cache"
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
with:
path: ~/.cache/lima
key: lima-${{ steps.lima-actions-setup.outputs.version }}
- name: "Init: start the guest VM"
run: |
set -eux
# containerd=none is set because the built-in containerd support conflicts with Docker
limactl start \
--name=default \
--cpus=4 \
--memory=12 \
--containerd=none \
--set '.mounts=null | .portForwards=[{"guestSocket":"/var/run/docker.sock","hostSocket":"{{.Dir}}/sock/docker.sock"}]' \
template://${{ inputs.guest }}
# FIXME: the tests should be directly executed in the VM without nesting Docker inside it
# https://github.com/containerd/nerdctl/issues/3858
- name: "Init: install dockerd in the guest VM"
run: |
set -eux
lima sudo mkdir -p /etc/systemd/system/docker.socket.d
cat <<-EOF | lima sudo tee /etc/systemd/system/docker.socket.d/override.conf
[Socket]
SocketUser=$(whoami)
EOF
lima sudo dnf config-manager --add-repo=https://download.docker.com/linux/centos/docker-ce.repo
lima sudo dnf -q -y install docker-ce --nobest
lima sudo systemctl enable --now docker
- name: "Init: configure the host to use dockerd in the guest VM"
run: |
set -eux
sudo systemctl disable --now docker.service docker.socket
export DOCKER_HOST="unix://$(limactl ls --format '{{.Dir}}/sock/docker.sock' default)"
echo "DOCKER_HOST=${DOCKER_HOST}" >>$GITHUB_ENV
docker info
docker version
- name: "Init: expose GitHub Runtime variables for gha"
uses: crazy-max/ghaction-github-runtime@3cb05d89e1f492524af3d41a1c98c83bc3025124 # v3.1.0
- name: "Init: prepare integration tests"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
set -eux
sudo losetup -Dv
sudo losetup -lv
[ "$TARGET" = "rootless" ] && TARGET=test-integration-rootless || TARGET=test-integration
docker buildx create --name with-gha --use
docker buildx build \
--secret id=github_token,env=GITHUB_TOKEN \
--output=type=docker \
--cache-from type=gha,scope=test-integration-dependencies-amd64 \
-t test-integration --target "${TARGET}" \
.
- name: "Run integration tests"
# Presumably, something is broken with the way docker exposes /dev to the container, as it appears to only
# randomly work. Mounting /dev does workaround the issue.
# This might be due to the old kernel shipped with Alma (4.18), or something else between centos/docker.
run: |
set -eux
if [ "$TARGET" = "rootless" ]; then
echo "rootless"
docker run -t -v /dev:/dev --rm --privileged test-integration /test-integration-rootless.sh ./hack/test-integration.sh -test.only-flaky=false
else
echo "rootful"
docker run -t -v /dev:/dev --rm --privileged test-integration ./hack/test-integration.sh -test.only-flaky=false
fi
- name: "Run: integration tests (flaky)"
run: |
set -eux
if [ "$TARGET" = "rootless" ]; then
echo "rootless"
docker run -t -v /dev:/dev --rm --privileged test-integration /test-integration-rootless.sh ./hack/test-integration.sh -test.only-flaky=true
else
echo "rootful"
docker run -t -v /dev:/dev --rm --privileged test-integration ./hack/test-integration.sh -test.only-flaky=true
fi

View File

@ -0,0 +1,60 @@
# Right now, this is testing solely FreeBSD, but could be used to test other targets.
# Alternatively, this might get replaced entirely by Lima eventually.
name: job-test-in-vagrant
on:
workflow_call:
inputs:
timeout:
required: true
type: number
runner:
required: true
type: string
jobs:
test:
# Will appear as freebsd / 14 in GitHub UI
name: "14"
timeout-minutes: ${{ inputs.timeout }}
runs-on: "${{ inputs.runner }}"
steps:
- name: "Init: checkout"
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 1
- name: "Init: setup cache"
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
with:
path: /root/.vagrant.d
key: vagrant
- name: "Init: set up vagrant"
run: |
# from https://github.com/containerd/containerd/blob/v2.0.2/.github/workflows/ci.yml#L583-L596
# which is based on https://github.com/opencontainers/runc/blob/v1.1.8/.cirrus.yml#L41-L49
# FIXME: https://github.com/containerd/nerdctl/issues/4163
cat ./hack/provisioning/gpg/hashicorp | sudo gpg --dearmor -o /usr/share/keyrings/hashicorp-archive-keyring.gpg
echo "deb [signed-by=/usr/share/keyrings/hashicorp-archive-keyring.gpg] https://apt.releases.hashicorp.com $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/hashicorp.list
sudo sed -i 's/^Types: deb$/Types: deb deb-src/' /etc/apt/sources.list.d/ubuntu.sources
sudo apt-get update -qq
sudo apt-get install -qq libvirt-daemon libvirt-daemon-system vagrant ovmf
# https://github.com/vagrant-libvirt/vagrant-libvirt/issues/1725#issuecomment-1454058646
sudo cp /usr/share/OVMF/OVMF_VARS_4M.fd /var/lib/libvirt/qemu/nvram/
sudo systemctl enable --now libvirtd
sudo apt-get build-dep -qq ruby-libvirt
sudo apt-get install -qq --no-install-recommends libxslt-dev libxml2-dev libvirt-dev ruby-bundler ruby-dev zlib1g-dev
# Disable strict dependency enforcement to bypass gem version conflicts during the installation of the vagrant-libvirt plugin.
sudo env VAGRANT_DISABLE_STRICT_DEPENDENCY_ENFORCEMENT=1 vagrant plugin install vagrant-libvirt
- name: "Init: boot VM"
run: |
ln -sf Vagrantfile.freebsd Vagrantfile
sudo vagrant up --no-tty
- name: "Run: test-unit"
run: sudo vagrant up --provision-with=test-unit
- name: "Run: test-integration"
run: sudo vagrant up --provision-with=test-integration

88
.github/workflows/job-test-unit.yml vendored Normal file
View File

@ -0,0 +1,88 @@
# Note: freebsd tests are not ran here (see integration instead)
name: job-test-unit
on:
workflow_call:
inputs:
timeout:
required: true
type: number
go-version:
required: true
type: string
runner:
required: true
type: string
canary:
required: false
default: false
type: boolean
windows-cni-version:
required: true
type: string
linux-cni-version:
required: true
type: string
linux-cni-sha:
required: true
type: string
env:
GOTOOLCHAIN: local
# Windows fails without this
CGO_ENABLED: 0
jobs:
test-unit:
name: ${{ format('{0}{1}', inputs.runner, inputs.canary && ' (go canary)' || '') }}
timeout-minutes: ${{ inputs.timeout }}
runs-on: "${{ inputs.runner }}"
defaults:
run:
shell: bash
env:
GO_VERSION: ${{ inputs.go-version }}
steps:
- name: "Init: checkout"
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 1
# If canary is requested, check for the latest unstable release
- if: ${{ inputs.canary }}
name: "Init (canary): retrieve GO_VERSION"
run: |
latest_go="$(. ./hack/provisioning/version/fetch.sh; go::canary::for::go-setup)"
printf "GO_VERSION=%s\n" "$latest_go" >> "$GITHUB_ENV"
[ "$latest_go" != "" ] || \
echo "::warning title=No canary go::There is currently no canary go version to test. Following steps will not run."
- if: ${{ env.GO_VERSION != '' }}
name: "Init: install go"
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
with:
go-version: ${{ env.GO_VERSION }}
check-latest: true
# Install CNI
- if: ${{ env.GO_VERSION != '' }}
name: "Init: set up CNI"
run: |
if [ "$RUNNER_OS" == "Windows" ]; then
GOPATH=$(go env GOPATH) WINCNI_VERSION=${{ inputs.windows-cni-version }} ./hack/provisioning/windows/cni.sh
elif [ "$RUNNER_OS" == "Linux" ]; then
./hack/provisioning/linux/cni.sh install "${{ inputs.linux-cni-version }}" "amd64" "${{ inputs.linux-cni-sha }}"
fi
- if: ${{ env.GO_VERSION != '' }}
name: "Run"
run: |
make test-unit
# On linux, also run with root
- if: ${{ env.GO_VERSION != '' && env.RUNNER_OS == 'Linux' }}
name: "Run: with root"
run: |
sudo make test-unit

View File

@ -1,78 +0,0 @@
name: lint
on:
push:
branches:
- main
- 'release/**'
pull_request:
env:
GO_VERSION: 1.23.x
jobs:
go:
timeout-minutes: 5
name: "go | ${{ matrix.goos }} | ${{ matrix.canary }}"
runs-on: "${{ matrix.os }}"
defaults:
run:
shell: bash
strategy:
matrix:
include:
- os: ubuntu-24.04
goos: linux
- os: ubuntu-24.04
goos: freebsd
# FIXME: this is currently failing in a non-sensical way, so, running on linux instead...
# - os: windows-2022
- os: ubuntu-24.04
goos: windows
- os: ubuntu-24.04
goos: linux
# This allows the canary script to select any upcoming golang alpha/beta/RC
canary: go-canary
env:
GOOS: "${{ matrix.goos }}"
steps:
- uses: actions/checkout@v4.2.2
with:
fetch-depth: 1
- name: Set GO env
run: |
# If canary is specified, get the latest available golang pre-release instead of the major version
if [ "$canary" != "" ]; then
. ./hack/build-integration-canary.sh
canary::golang::latest
fi
- uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
check-latest: true
cache: true
- name: golangci-lint
uses: golangci/golangci-lint-action@v6
with:
args: --verbose
other:
timeout-minutes: 5
name: yaml | shell | imports order
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4.2.2
with:
fetch-depth: 1
- uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
check-latest: true
cache: true
- name: yaml
run: make lint-yaml
- name: shell
run: make lint-shell
- name: go imports ordering
run: |
go install -v github.com/incu6us/goimports-reviser/v3@latest
make lint-imports

View File

@ -1,31 +0,0 @@
name: project
on:
push:
branches:
- main
- 'release/**'
pull_request:
jobs:
project:
name: checks
runs-on: ubuntu-24.04
timeout-minutes: 20
steps:
- uses: actions/checkout@v4.2.2
with:
path: src/github.com/containerd/nerdctl
fetch-depth: 100
- uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
cache-dependency-path: src/github.com/containerd/nerdctl
- uses: containerd/project-checks@v1.1.0
with:
working-directory: src/github.com/containerd/nerdctl
repo-access-token: ${{ secrets.GITHUB_TOKEN }}
- run: ./hack/verify-no-patent.sh
working-directory: src/github.com/containerd/nerdctl
- run: ./hack/verify-pkg-isolation.sh
working-directory: src/github.com/containerd/nerdctl

View File

@ -5,16 +5,36 @@ on:
tags:
- 'v*'
- 'test-action-release-*'
pull_request:
paths-ignore:
- '**.md'
env:
GOTOOLCHAIN: local
jobs:
release:
runs-on: ubuntu-24.04
timeout-minutes: 40
# The maximum access is "read" for PRs from public forked repos
# https://docs.github.com/en/actions/security-guides/automatic-token-authentication#permissions-for-the-github_token
permissions:
contents: write # for releases
id-token: write # for provenances
attestations: write # for provenances
steps:
- uses: actions/checkout@v4.2.2
- uses: actions/setup-go@v5
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
# FIXME: setup-qemu-action is depended by `gomodjail pack`
- name: "Set up QEMU"
uses: docker/setup-qemu-action@29109295f81e9208d7d86ff1c6c12d2833863392 # v3.6.0
- name: "Install go"
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
with:
go-version: 1.23.x
go-version: "1.24"
check-latest: true
- name: "Compile binaries"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: make artifacts
- name: "SHA256SUMS"
run: |
@ -35,7 +55,13 @@ jobs:
- - -
Release manager: [ADD YOUR NAME HERE] (@[ADD YOUR GITHUB ID HERE])
EOF
- name: "Generate artifact attestation"
uses: actions/attest-build-provenance@e8998f949152b193b063cb0ec769d69d929409be # v2.4.0
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
with:
subject-path: _output/*
- name: "Create release"
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |

View File

@ -1,99 +0,0 @@
# This pipeline purpose is solely meant to run a subset of our test suites against upcoming or unreleased dependencies versions
name: canary
on:
push:
branches:
- main
- 'release/**'
pull_request:
paths-ignore:
- '**.md'
env:
UBUNTU_VERSION: "24.04"
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
jobs:
linux:
runs-on: "ubuntu-24.04"
timeout-minutes: 40
steps:
- uses: actions/checkout@v4.2.2
with:
fetch-depth: 1
- name: "Prepare integration test environment"
run: |
. ./hack/build-integration-canary.sh
canary::build::integration
- name: "Remove snap loopback devices (conflicts with our loopback devices in TestRunDevice)"
run: |
sudo systemctl disable --now snapd.service snapd.socket
sudo apt-get purge -y snapd
sudo losetup -Dv
sudo losetup -lv
- name: "Register QEMU (tonistiigi/binfmt)"
run: |
# `--install all` will only install emulation for architectures that cannot be natively executed
# Since some arm64 platforms do provide native fallback execution for 32 bits,
# armv7 emulation may or may not be installed, causing variance in the result of `uname -m`.
# To avoid that, we explicitly list the architectures we do want emulation for.
docker run --privileged --rm tonistiigi/binfmt --install linux/amd64
docker run --privileged --rm tonistiigi/binfmt --install linux/arm64
docker run --privileged --rm tonistiigi/binfmt --install linux/arm/v7
- name: "Run unit tests"
run: go test -v ./pkg/...
- name: "Run integration tests"
run: docker run -t --rm --privileged test-integration ./hack/test-integration.sh -test.only-flaky=false
- name: "Run integration tests (flaky)"
run: docker run -t --rm --privileged test-integration ./hack/test-integration.sh -test.only-flaky=true
windows:
timeout-minutes: 30
runs-on: windows-latest
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v4.2.2
with:
fetch-depth: 1
- name: Set GO env
run: |
# Get latest containerd
args=(curl --proto '=https' --tlsv1.2 -fsSL -H "Accept: application/vnd.github+json" -H "X-GitHub-Api-Version: 2022-11-28")
[ "${GITHUB_TOKEN:-}" == "" ] && {
>&2 printf "GITHUB_TOKEN is not set - you might face rate limitations with the Github API\n"
} || args+=(-H "Authorization: Bearer $GITHUB_TOKEN")
ctd_v="$("${args[@]}" https://api.github.com/repos/containerd/containerd/tags | jq -rc .[0].name)"
echo "CONTAINERD_VERSION=${ctd_v:1}" >> "$GITHUB_ENV"
. ./hack/build-integration-canary.sh
canary::golang::latest
- uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
cache: true
check-latest: true
- run: go install ./cmd/nerdctl
- run: go install -v gotest.tools/gotestsum@v1
# This here is solely to get the cni install script, which has not been modified in 3+ years.
# There is little to no reason to update this to latest containerd
- uses: actions/checkout@v4.2.2
with:
repository: containerd/containerd
ref: "v1.7.23"
path: containerd
fetch-depth: 1
- name: "Set up CNI"
working-directory: containerd
run: GOPATH=$(go env GOPATH) script/setup/install-cni-windows
# Windows setup script can only use released versions
- name: "Set up containerd"
env:
ctrdVersion: ${{ env.CONTAINERD_VERSION }}
run: powershell hack/configure-windows-ci.ps1
- name: "Run integration tests"
run: ./hack/test-integration.sh -test.only-flaky=false
- name: "Run integration tests (flaky)"
run: ./hack/test-integration.sh -test.only-flaky=true

View File

@ -1,27 +0,0 @@
# This pipeline purpose is solely meant to run a subset of our test suites against a kubernetes cluster
name: kubernetes
on:
push:
branches:
- main
- 'release/**'
pull_request:
paths-ignore:
- '**.md'
jobs:
linux:
runs-on: "ubuntu-24.04"
timeout-minutes: 40
env:
ROOTFUL: true
steps:
- uses: actions/checkout@v4.2.2
with:
fetch-depth: 1
- name: "Run Kubernetes integration tests"
# See https://github.com/containerd/nerdctl/blob/main/docs/testing/README.md#about-parallelization
run: |
./hack/build-integration-kubernetes.sh
sudo ./_output/nerdctl exec nerdctl-test-control-plane bash -c -- 'export TMPDIR="$HOME"/tmp; mkdir -p "$TMPDIR"; cd /nerdctl-source; /usr/local/go/bin/go test -p 1 ./cmd/nerdctl/... -test.only-kubernetes'

View File

@ -1,350 +0,0 @@
name: test
on:
push:
branches:
- main
- 'release/**'
pull_request:
paths-ignore:
- '**.md'
env:
GO_VERSION: 1.23.x
SHORT_TIMEOUT: 5
LONG_TIMEOUT: 60
jobs:
test-unit:
# Supposed to work: https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/evaluate-expressions-in-workflows-and-actions#example-returning-a-json-data-type
# Apparently does not
# timeout-minutes: ${{ fromJSON(env.SHORT_TIMEOUT) }}
timeout-minutes: 5
name: unit | ${{ matrix.goos }}
runs-on: "${{ matrix.os }}"
defaults:
run:
shell: bash
strategy:
matrix:
include:
- os: windows-2022
goos: windows
- os: ubuntu-24.04
goos: linux
steps:
- uses: actions/checkout@v4.2.2
with:
fetch-depth: 1
- uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
check-latest: true
cache: true
- if: ${{ matrix.goos=='windows' }}
uses: actions/checkout@v4.2.2
with:
repository: containerd/containerd
ref: v1.7.23
path: containerd
fetch-depth: 1
- if: ${{ matrix.goos=='windows' }}
name: "Set up CNI"
working-directory: containerd
run: GOPATH=$(go env GOPATH) script/setup/install-cni-windows
- name: "Run unit tests"
run: make test-unit
test-integration:
timeout-minutes: 60
name: rootful | ${{ matrix.containerd }} | ${{ matrix.runner }}
runs-on: "${{ matrix.runner }}"
strategy:
fail-fast: false
matrix:
# ubuntu-20.04: cgroup v1, ubuntu-22.04 and later: cgroup v2
include:
- ubuntu: 20.04
containerd: v1.6.36
runner: "ubuntu-20.04"
- ubuntu: 22.04
containerd: v1.7.23
runner: "ubuntu-22.04"
- ubuntu: 24.04
containerd: v2.0.0-rc.5
runner: "ubuntu-24.04"
- ubuntu: 24.04
containerd: v2.0.0-rc.5
runner: github-arm64-2c-8gb
env:
UBUNTU_VERSION: "${{ matrix.ubuntu }}"
CONTAINERD_VERSION: "${{ matrix.containerd }}"
steps:
- uses: actions/checkout@v4.2.2
with:
fetch-depth: 1
- name: "Prepare integration test environment"
run: docker build -t test-integration --target test-integration --build-arg UBUNTU_VERSION=${UBUNTU_VERSION} --build-arg CONTAINERD_VERSION=${CONTAINERD_VERSION} .
- name: "Remove snap loopback devices (conflicts with our loopback devices in TestRunDevice)"
run: |
sudo systemctl disable --now snapd.service snapd.socket
sudo apt-get purge -y snapd
sudo losetup -Dv
sudo losetup -lv
- name: "Register QEMU (tonistiigi/binfmt)"
run: |
# `--install all` will only install emulation for architectures that cannot be natively executed
# Since some arm64 platforms do provide native fallback execution for 32 bits,
# armv7 emulation may or may not be installed, causing variance in the result of `uname -m`.
# To avoid that, we explicitly list the architectures we do want emulation for.
docker run --privileged --rm tonistiigi/binfmt --install linux/amd64
docker run --privileged --rm tonistiigi/binfmt --install linux/arm64
docker run --privileged --rm tonistiigi/binfmt --install linux/arm/v7
- name: "Run integration tests"
run: docker run -t --rm --privileged test-integration ./hack/test-integration.sh -test.only-flaky=false
- name: "Run integration tests (flaky)"
run: docker run -t --rm --privileged test-integration ./hack/test-integration.sh -test.only-flaky=true
test-integration-ipv6:
timeout-minutes: 60
name: ipv6 | ${{ matrix.containerd }} | ${{ matrix.ubuntu }}
runs-on: "ubuntu-${{ matrix.ubuntu }}"
strategy:
fail-fast: false
matrix:
# ubuntu-20.04: cgroup v1, ubuntu-22.04 and later: cgroup v2
include:
- ubuntu: 24.04
containerd: v2.0.0-rc.5
env:
UBUNTU_VERSION: "${{ matrix.ubuntu }}"
CONTAINERD_VERSION: "${{ matrix.containerd }}"
steps:
- uses: actions/checkout@v4.2.2
with:
fetch-depth: 1
- name: Enable ipv4 and ipv6 forwarding
run: |
sudo sysctl -w net.ipv6.conf.all.forwarding=1
sudo sysctl -w net.ipv4.ip_forward=1
- name: Enable IPv6 for Docker
run: |
sudo mkdir -p /etc/docker
echo '{"ipv6": true, "fixed-cidr-v6": "2001:db8:1::/64", "experimental": true, "ip6tables": true}' | sudo tee /etc/docker/daemon.json
sudo systemctl restart docker
- name: "Prepare integration test environment"
run: docker build -t test-integration --target test-integration --build-arg UBUNTU_VERSION=${UBUNTU_VERSION} --build-arg CONTAINERD_VERSION=${CONTAINERD_VERSION} .
- name: "Remove snap loopback devices (conflicts with our loopback devices in TestRunDevice)"
run: |
sudo systemctl disable --now snapd.service snapd.socket
sudo apt-get purge -y snapd
sudo losetup -Dv
sudo losetup -lv
- name: "Register QEMU (tonistiigi/binfmt)"
run: |
# `--install all` will only install emulation for architectures that cannot be natively executed
# Since some arm64 platforms do provide native fallback execution for 32 bits,
# armv7 emulation may or may not be installed, causing variance in the result of `uname -m`.
# To avoid that, we explicitly list the architectures we do want emulation for.
docker run --privileged --rm tonistiigi/binfmt --install linux/amd64
docker run --privileged --rm tonistiigi/binfmt --install linux/arm64
docker run --privileged --rm tonistiigi/binfmt --install linux/arm/v7
- name: "Run integration tests"
# The nested IPv6 network inside docker and qemu is complex and needs a bunch of sysctl config.
# Therefore, it's hard to debug why the IPv6 tests fail in such an isolation layer.
# On the other side, using the host network is easier at configuration.
# Besides, each job is running on a different instance, which means using host network here
# is safe and has no side effects on others.
run: docker run --network host -t --rm --privileged test-integration ./hack/test-integration.sh -test.only-ipv6
test-integration-rootless:
timeout-minutes: 60
name: "${{ matrix.target }} | ${{ matrix.containerd }} | ${{ matrix.rootlesskit }} | ${{ matrix.ubuntu }}"
runs-on: "ubuntu-${{ matrix.ubuntu }}"
strategy:
fail-fast: false
matrix:
# ubuntu-20.04: cgroup v1, ubuntu-22.04 and later: cgroup v2
include:
- ubuntu: 20.04
containerd: v1.6.36
rootlesskit: v1.1.1 # Deprecated
target: rootless
- ubuntu: 22.04
containerd: v1.7.23
rootlesskit: v2.3.1
target: rootless
- ubuntu: 24.04
containerd: v2.0.0-rc.5
rootlesskit: v2.3.1
target: rootless
- ubuntu: 24.04
containerd: v1.7.23
rootlesskit: v2.3.1
target: rootless-port-slirp4netns
env:
UBUNTU_VERSION: "${{ matrix.ubuntu }}"
CONTAINERD_VERSION: "${{ matrix.containerd }}"
ROOTLESSKIT_VERSION: "${{ matrix.rootlesskit }}"
TEST_TARGET: "test-integration-${{ matrix.target }}"
steps:
- name: "Set up AppArmor"
if: matrix.ubuntu == '24.04'
run: |
cat <<EOT | sudo tee "/etc/apparmor.d/usr.local.bin.rootlesskit"
abi <abi/4.0>,
include <tunables/global>
/usr/local/bin/rootlesskit flags=(unconfined) {
userns,
# Site-specific additions and overrides. See local/README for details.
include if exists <local/usr.local.bin.rootlesskit>
}
EOT
sudo systemctl restart apparmor.service
- uses: actions/checkout@v4.2.2
with:
fetch-depth: 1
- name: "Register QEMU (tonistiigi/binfmt)"
run: |
# `--install all` will only install emulation for architectures that cannot be natively executed
# Since some arm64 platforms do provide native fallback execution for 32 bits,
# armv7 emulation may or may not be installed, causing variance in the result of `uname -m`.
# To avoid that, we explicitly list the architectures we do want emulation for.
docker run --privileged --rm tonistiigi/binfmt --install linux/amd64
docker run --privileged --rm tonistiigi/binfmt --install linux/arm64
docker run --privileged --rm tonistiigi/binfmt --install linux/arm/v7
- name: "Prepare (network driver=slirp4netns, port driver=builtin)"
run: docker build -t ${TEST_TARGET} --target ${TEST_TARGET} --build-arg UBUNTU_VERSION=${UBUNTU_VERSION} --build-arg CONTAINERD_VERSION=${CONTAINERD_VERSION} --build-arg ROOTLESSKIT_VERSION=${ROOTLESSKIT_VERSION} .
- name: "Disable BuildKit for RootlessKit v1 (workaround for issue #622)"
run: |
# https://github.com/containerd/nerdctl/issues/622
WORKAROUND_ISSUE_622=
if echo "${ROOTLESSKIT_VERSION}" | grep -q v1; then
WORKAROUND_ISSUE_622=1
fi
echo "WORKAROUND_ISSUE_622=${WORKAROUND_ISSUE_622}" >> "$GITHUB_ENV"
- name: "Test (network driver=slirp4netns, port driver=builtin)"
run: docker run -t --rm --privileged -e WORKAROUND_ISSUE_622=${WORKAROUND_ISSUE_622} ${TEST_TARGET} /test-integration-rootless.sh ./hack/test-integration.sh -test.only-flaky=false
- name: "Test (network driver=slirp4netns, port driver=builtin) (flaky)"
run: docker run -t --rm --privileged -e WORKAROUND_ISSUE_622=${WORKAROUND_ISSUE_622} ${TEST_TARGET} /test-integration-rootless.sh ./hack/test-integration.sh -test.only-flaky=true
build:
timeout-minutes: 5
name: "build | ${{ matrix.go-version }}"
runs-on: ubuntu-24.04
strategy:
matrix:
go-version: ["1.22.x", "1.23.x"]
steps:
- uses: actions/checkout@v4.2.2
with:
fetch-depth: 1
- uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}
cache: true
check-latest: true
- name: "build"
run: GO_VERSION="$(echo ${{ matrix.go-version }} | sed -e s/.x//)" make binaries
test-integration-docker-compatibility:
timeout-minutes: 60
name: docker
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4.2.2
with:
fetch-depth: 1
- uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
cache: true
check-latest: true
- name: "Print docker info"
run: |
set -eux -o pipefail
docker info
docker version
- name: "Register QEMU (tonistiigi/binfmt)"
run: |
# `--install all` will only install emulation for architectures that cannot be natively executed
# Since some arm64 platforms do provide native fallback execution for 32 bits,
# armv7 emulation may or may not be installed, causing variance in the result of `uname -m`.
# To avoid that, we explicitly list the architectures we do want emulation for.
docker run --privileged --rm tonistiigi/binfmt --install linux/amd64
docker run --privileged --rm tonistiigi/binfmt --install linux/arm64
docker run --privileged --rm tonistiigi/binfmt --install linux/arm/v7
- name: "Prepare integration test environment"
run: |
sudo apt-get install -y expect
go install -v gotest.tools/gotestsum@v1
- name: "Ensure that the integration test suite is compatible with Docker"
run: WITH_SUDO=true ./hack/test-integration.sh -test.target=docker
- name: "Ensure that the IPv6 integration test suite is compatible with Docker"
run: WITH_SUDO=true ./hack/test-integration.sh -test.target=docker -test.only-ipv6
- name: "Ensure that the integration test suite is compatible with Docker (flaky only)"
run: WITH_SUDO=true ./hack/test-integration.sh -test.target=docker -test.only-flaky
test-integration-windows:
timeout-minutes: 30
name: windows
runs-on: windows-2022
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v4.2.2
with:
fetch-depth: 1
- uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
cache: true
check-latest: true
- run: go install ./cmd/nerdctl
- run: go install -v gotest.tools/gotestsum@v1
- uses: actions/checkout@v4.2.2
with:
repository: containerd/containerd
ref: v1.7.23
path: containerd
fetch-depth: 1
- name: "Set up CNI"
working-directory: containerd
run: GOPATH=$(go env GOPATH) script/setup/install-cni-windows
- name: "Set up containerd"
env:
ctrdVersion: 1.7.23
run: powershell hack/configure-windows-ci.ps1
- name: "Run integration tests"
run: ./hack/test-integration.sh -test.only-flaky=false
- name: "Run integration tests (flaky)"
run: ./hack/test-integration.sh -test.only-flaky=true
test-integration-freebsd:
timeout-minutes: 60
name: FreeBSD
# ubuntu-24.04 lacks the vagrant package
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4.2.2
- uses: actions/cache@v4
with:
path: /root/.vagrant.d
key: vagrant-${{ matrix.box }}
- name: Set up vagrant
run: |
sudo apt-get update
sudo apt-get install -y libvirt-daemon libvirt-daemon-system vagrant vagrant-libvirt
sudo systemctl enable --now libvirtd
- name: Boot VM
run: |
ln -sf Vagrantfile.freebsd Vagrantfile
sudo vagrant up --no-tty
- name: test-unit
run: sudo vagrant up --provision-with=test-unit
- name: test-integration
run: sudo vagrant up --provision-with=test-integration

56
.github/workflows/workflow-flaky.yml vendored Normal file
View File

@ -0,0 +1,56 @@
# This workflow puts together all known "flaky" and experimental targets
name: "[flaky, see #3988]"
on:
push:
branches:
- main
- 'release/**'
pull_request:
paths-ignore:
- '**.md'
jobs:
test-integration-el:
name: "EL${{ inputs.hack }}"
uses: ./.github/workflows/job-test-in-lima.yml
strategy:
fail-fast: false
# EL8 is used for testing compatibility with cgroup v1.
# Unfortunately, EL8 is hard to debug for M1 users (as Lima+M1+EL8 is not runnable because of page size),
# and it currently shows numerous issues.
# Thus, EL9 is also added as target (for a limited time?) so that we can figure out which issues are EL8 specific,
# and which issues could be reproduced on EL9 as well (which would be easier to debug).
matrix:
guest: ["almalinux-8", "almalinux-9"]
target: ["rootful", "rootless"]
with:
timeout: 60
runner: ubuntu-24.04
guest: ${{ matrix.guest }}
target: ${{ matrix.target }}
test-integration-freebsd:
name: "FreeBSD"
uses: ./.github/workflows/job-test-in-vagrant.yml
with:
timeout: 15
runner: ubuntu-24.04
kube:
name: "kubernetes"
runs-on: ubuntu-24.04
timeout-minutes: 15
env:
ROOTFUL: true
steps:
- name: "Init: checkout"
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 1
- name: "Run"
run: |
# FIXME: this should be a bit more elegant to use.
./hack/provisioning/kube/kind.sh
# See https://github.com/containerd/nerdctl/blob/main/docs/testing/README.md#about-parallelization
sudo ./_output/nerdctl exec nerdctl-test-control-plane bash -c -- 'export TMPDIR="$HOME"/tmp; mkdir -p "$TMPDIR"; cd /nerdctl-source; /usr/local/go/bin/go test -p 1 ./cmd/nerdctl/... -test.only-kubernetes'

80
.github/workflows/workflow-lint.yml vendored Normal file
View File

@ -0,0 +1,80 @@
name: lint
on:
push:
branches:
- main
- 'release/**'
pull_request:
jobs:
# Runs golangci to ensure that:
# 1. the tooling is working on the target platform
# 2. the linter is happy
# 3. for canary (if there is a canary go version), does lint for all supported goos
lint-go:
name: "go${{ inputs.hack }}"
uses: ./.github/workflows/job-lint-go.yml
strategy:
fail-fast: false
matrix:
include:
- runner: ubuntu-24.04
goos: linux
- runner: ubuntu-24.04
goos: freebsd
- runner: macos-15
goos: darwin
# FIXME: this is currently failing in a nonsensical way, so, running on linux instead...
# - runner: windows-2022
- runner: ubuntu-24.04
goos: windows
# Additionally lint for canary
- runner: ubuntu-24.04
goos: linux
canary: true
with:
timeout: 5
go-version: "1.24"
runner: ubuntu-24.04
# Note: in GitHub yaml world, if `matrix.canary` is undefined, and is passed to `inputs.canary`, the job
# will not run. However, if you test it, it will coerce to `false`, hence:
canary: ${{ matrix.canary && true || false }}
goos: ${{ matrix.goos }}
# Run common project checks (commits, licenses, etc)
lint-project-checks:
name: "project checks"
uses: ./.github/workflows/job-lint-project.yml
with:
timeout: 5
go-version: "1.24"
runner: ubuntu-24.04
# Lint for shell and yaml files
lint-other:
name: "other"
uses: ./.github/workflows/job-lint-other.yml
with:
timeout: 5
runner: ubuntu-24.04
# Verify we can actually build on all supported platforms, and a bunch of architectures
build-for-go:
name: "build for${{ inputs.hack }}"
uses: ./.github/workflows/job-build.yml
strategy:
fail-fast: false
matrix:
include:
# Build for both old and stable go
- go-version: "1.23"
- go-version: "1.24"
# Additionally build for canary
- go-version: "1.24"
canary: true
with:
timeout: 10
go-version: ${{ matrix.go-version }}
runner: ubuntu-24.04
canary: ${{ matrix.canary && true || false }}

149
.github/workflows/workflow-test.yml vendored Normal file
View File

@ -0,0 +1,149 @@
name: test
on:
push:
branches:
- main
- 'release/**'
pull_request:
paths-ignore:
- '**.md'
jobs:
test-unit:
# Note: inputs.hack is undefined - its purpose is to prevent GitHub Actions from displaying all matrix variants as part of the name.
name: "unit${{ inputs.hack }}"
uses: ./.github/workflows/job-test-unit.yml
strategy:
fail-fast: false
matrix:
# Run on all supported platforms but freebsd
# Additionally run on canary for linux
include:
- runner: "ubuntu-24.04"
- runner: "macos-15"
- runner: "windows-2025"
- runner: "ubuntu-24.04"
canary: true
with:
runner: ${{ matrix.runner }}
canary: ${{ matrix.canary && true || false }}
# Windows routinely go over 5 minutes
timeout: 10
go-version: 1.24
windows-cni-version: v0.3.1
linux-cni-version: v1.7.1
linux-cni-sha: 1a28a0506bfe5bcdc981caf1a49eeab7e72da8321f1119b7be85f22621013098
# This job builds the dependency target of the test-image for all supported architectures and cache it in GHA
build-dependencies:
name: "dependencies${{ inputs.hack }}"
uses: ./.github/workflows/job-test-dependencies.yml
strategy:
fail-fast: false
matrix:
include:
# Build for arm & amd, current containerd
- runner: ubuntu-24.04
- runner: ubuntu-24.04-arm
# Additionally build for old containerd on amd
- runner: ubuntu-24.04
containerd-version: v1.6.38
with:
runner: ${{ matrix.runner }}
containerd-version: ${{ matrix.containerd-version }}
timeout: 20
test-integration-container:
name: "in-container${{ inputs.hack }}"
uses: ./.github/workflows/job-test-in-container.yml
needs: build-dependencies
strategy:
fail-fast: false
matrix:
include:
###### Rootless
# amd64
- runner: ubuntu-24.04
target: rootless
# arm64
- runner: ubuntu-24.04-arm
target: rootless
# port-slirp4netns
- runner: ubuntu-24.04
target: rootless-port-slirp4netns
# old containerd + old ubuntu + old rootlesskit
- runner: ubuntu-22.04
target: rootless
containerd-version: v1.6.38
rootlesskit-version: v1.1.1
# gomodjail
- runner: ubuntu-24.04
target: rootless
binary: "nerdctl.gomodjail"
###### Rootful
# amd64
- runner: ubuntu-24.04
target: rootful
# arm64
- runner: ubuntu-24.04-arm
target: rootful
# old containerd + old ubuntu
- runner: ubuntu-22.04
target: rootful
containerd-version: v1.6.38
# ipv6
- runner: ubuntu-24.04
target: rootful
ipv6: true
# all canary
- runner: ubuntu-24.04
target: rootful
canary: true
with:
timeout: 60
runner: ${{ matrix.runner }}
target: ${{ matrix.target }}
binary: ${{ matrix.binary && matrix.binary || 'nerdctl' }}
containerd-version: ${{ matrix.containerd-version }}
rootlesskit-version: ${{ matrix.rootlesskit-version }}
ipv6: ${{ matrix.ipv6 && true || false }}
canary: ${{ matrix.canary && true || false }}
test-integration-host:
name: "in-host${{ inputs.hack }}"
uses: ./.github/workflows/job-test-in-host.yml
strategy:
fail-fast: false
matrix:
include:
# Test on windows w/o canary
- runner: windows-2022
- runner: windows-2025
canary: true
# Test docker on linux
- runner: ubuntu-24.04
binary: docker
# FIXME: running nerdctl on the host is work in progress
# (we miss runc to be installed on the host - and obviously other deps)
# Plan is to pause this for now and first consolidate dependencies management (wrt Dockerfile vs. host-testing CI)
# before we can really start testing linux nerdctl on the host.
# - runner: ubuntu-24.04
# - runner: ubuntu-24.04
# canary: true
with:
timeout: 45
runner: ${{ matrix.runner }}
binary: ${{ matrix.binary != '' && matrix.binary || 'nerdctl' }}
canary: ${{ matrix.canary && true || false }}
go-version: 1.24
windows-cni-version: v0.3.1
docker-version: 5:28.0.4-1~ubuntu.24.04~noble
containerd-version: 2.1.3
# Note: these as for amd64
containerd-sha: 436cc160c33b37ec25b89fb5c72fc879ab2b3416df5d7af240c3e9c2f4065d3c
containerd-service-sha: 1941362cbaa89dd591b99c32b050d82c583d3cd2e5fa63085d7017457ec5fca8
linux-cni-version: v1.7.1
linux-cni-sha: 1a28a0506bfe5bcdc981caf1a49eeab7e72da8321f1119b7be85f22621013098

95
.github/workflows/workflow-tigron.yml vendored Normal file
View File

@ -0,0 +1,95 @@
name: tigron
on:
push:
branches:
- main
- 'release/**'
pull_request:
paths: 'mod/tigron/**'
env:
GO_VERSION: "1.24"
GOTOOLCHAIN: local
jobs:
lint:
timeout-minutes: 15
name: "${{ matrix.goos }} ${{ matrix.runner }} | go ${{ matrix.canary }}"
runs-on: ${{ matrix.runner }}
defaults:
run:
shell: bash
strategy:
matrix:
include:
- runner: ubuntu-24.04
- runner: macos-15
- runner: windows-2022
- runner: ubuntu-24.04
goos: freebsd
- runner: ubuntu-24.04
canary: go-canary
steps:
- name: "Checkout project"
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 100
- if: ${{ matrix.canary }}
name: "Init (canary): retrieve GO_VERSION"
run: |
latest_go="$(. ./hack/provisioning/version/fetch.sh; go::canary::for::go-setup)"
printf "GO_VERSION=%s\n" "$latest_go" >> "$GITHUB_ENV"
[ "$latest_go" != "" ] || \
echo "::warning title=No canary go::There is currently no canary go version to test. Steps will not run."
- if: ${{ env.GO_VERSION != '' }}
name: "Install go"
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
with:
go-version: ${{ env.GO_VERSION }}
check-latest: true
- if: ${{ env.GO_VERSION != '' }}
name: "Install tools"
run: |
cd mod/tigron
echo "::group:: make install-dev-tools"
make install-dev-tools
if [ "$RUNNER_OS" == macOS ]; then
brew install yamllint shellcheck
fi
echo "::endgroup::"
- if: ${{ env.GO_VERSION != '' && matrix.goos == '' }}
name: "lint"
env:
NO_COLOR: true
run: |
if [ "$RUNNER_OS" == Linux ]; then
echo "::group:: lint"
cd mod/tigron
export LINT_COMMIT_RANGE="$(jq -r '.after + "..HEAD"' ${GITHUB_EVENT_PATH})"
make lint
echo "::endgroup::"
else
echo "Lint is disabled on $RUNNER_OS"
fi
- if: ${{ env.GO_VERSION != '' }}
name: "test-unit"
run: |
echo "::group:: unit test"
cd mod/tigron
make test-unit
echo "::endgroup::"
- if: ${{ env.GO_VERSION != '' }}
name: "test-unit-race"
run: |
echo "::group:: race test"
cd mod/tigron
make test-unit-race
echo "::endgroup::"
- if: ${{ env.GO_VERSION != '' }}
name: "test-unit-bench"
run: |
echo "::group:: bench"
cd mod/tigron
make test-unit-bench
echo "::endgroup::"

1
.gitignore vendored
View File

@ -1,6 +1,7 @@
# artifacts
/nerdctl
_output
*.gomodjail
# golangci-lint
/build

View File

@ -1,142 +1,275 @@
---
version: "2"
run:
concurrency: 6
timeout: 5m
linters:
disable-all: true
enable:
# - depguard
- gofmt
- goimports
- govet
- ineffassign
- misspell
- nakedret
- prealloc
- typecheck
# - asciicheck
# - bodyclose
# - dogsled
# - dupl
# - errcheck
# - errorlint
# - exhaustive
# - exhaustivestruct
# - exportloopref
# - funlen
# - gci
# - gochecknoglobals
# - gochecknoinits
# - gocognit
# - goconst
# - gocritic
# - gocyclo
# - godot
# - godox
# - goerr113
# - gofumpt
# - goheader
# - golint
# - gomnd
# - gomodguard
# - goprintffuncname
# - gosec (gas)
- gosimple # (megacheck)
# - interfacer
# - lll
# - maligned
# - nestif
# - nlreturn
# - noctx
# - nolintlint
- revive
# - rowserrcheck
# - scopelint
# - sqlclosecheck
- staticcheck
- stylecheck
# - testpackage
# - tparallel
- unconvert
# - unparam
- unused
# - whitespace
# - wrapcheck
# - wsl
linters-settings:
gocritic:
enabled-checks:
# Diagnostic
- appendAssign
- argOrder
- badCond
- caseOrder
- codegenComment
- commentedOutCode
- deprecatedComment
- dupArg
- dupBranchBody
- dupCase
- dupSubExpr
- exitAfterDefer
- flagDeref
- flagName
- nilValReturn
- offBy1
- sloppyReassign
- weakCond
- octalLiteral
# Performance
- appendCombine
- equalFold
- hugeParam
- indexAlloc
- rangeExprCopy
- rangeValCopy
# Style
- assignOp
- boolExprSimplify
- captLocal
- commentFormatting
- commentedOutImport
- defaultCaseOrder
- docStub
- elseif
- emptyFallthrough
- emptyStringTest
- hexLiteral
- ifElseChain
- methodExprCall
- regexpMust
- singleCaseSwitch
- sloppyLen
- stringXbytes
- switchTrue
- typeAssertChain
- typeSwitchVar
- underef
- unlabelStmt
- unlambda
- unslice
- valSwap
- wrapperFunc
- yodaStyleExpr
# Opinionated
- builtinShadow
- importShadow
- initClause
- nestingReduce
- paramTypeCombine
- ptrToRefParam
- typeUnparen
- unnamedResult
- unnecessaryBlock
modules-download-mode: readonly
issues:
exclude-rules:
- linters:
- revive
text: "unused-parameter"
max-issues-per-linter: 0
max-same-issues: 0
linters:
default: none
enable:
# 1. This is the default enabled set of golanci
# We should consider enabling errcheck
# - errcheck
- govet
- ineffassign
- staticcheck
- unused
# 2. These are not part of the default set
# Important to prevent import of certain packages
- depguard
# Removes unnecessary conversions
- unconvert
# Flag common typos
- misspell
# A meta-linter seen as a good replacement for golint
- revive
# Gocritic
- gocritic
- forbidigo
# 3. We used to use these, but have now removed them
# Use of prealloc is generally premature optimization and performance profiling should be done instead
# https://golangci-lint.run/usage/linters/#prealloc
# - prealloc
# Provided by revive in a better way
# - nakedret
settings:
forbidigo:
forbid:
# FIXME: there are still calls to os.WriteFile in tests under `cmd`
- pattern: ^os\.WriteFile.*$
pkg: github.com/containerd/nerdctl/v2/pkg
msg: os.WriteFile is neither atomic nor durable - use nerdctl filesystem.WriteFile instead
- pattern: ^os\.ReadFile.*$
pkg: github.com/containerd/nerdctl/v2/pkg
msg: use filesystem.ReadFile instead of os.ReadFile
staticcheck:
checks:
# Below is the default set
- "all"
- "-ST1000"
- "-ST1003"
- "-ST1016"
- "-ST1020"
- "-ST1021"
- "-ST1022"
##### TODO: fix and enable these
# 6 occurrences.
# Apply De Morgans law https://staticcheck.dev/docs/checks#QF1001
- "-QF1001"
# 10 occurrences.
# Convert if/else-if chain to tagged switch https://staticcheck.dev/docs/checks#QF1003
- "-QF1003"
##### These have been vetted to be disabled.
# 55 occurrences. Omit embedded fields from selector expression https://staticcheck.dev/docs/checks#QF1008
# Usefulness is questionable.
- "-QF1008"
revive:
enable-all-rules: true
rules:
# See https://revive.run/r
##### P0: we should do it ASAP.
- name: max-control-nesting
# 10 occurences (at default 5). Deep nesting hurts readibility.
arguments: [7]
- name: deep-exit
# 11 occurrences. Do not exit in random places.
disabled: true
- name: unchecked-type-assertion
# 14 occurrences. This is generally risky and encourages bad coding for newcomers.
disabled: true
- name: bare-return
# 31 occurrences. Bare returns are just evil, very unfriendly, and make reading and editing much harder.
disabled: true
- name: import-shadowing
# 44 occurrences. Shadowing makes things prone to errors / confusing to read.
disabled: true
- name: use-errors-new
# 84 occurrences. Improves error testing.
disabled: true
##### P1: consider making a dent on these, but not critical.
- name: argument-limit
# 4 occurrences (at default 8). Long windy arguments list for functions are hard to read. Use structs instead.
arguments: [12]
- name: unnecessary-stmt
# 5 occurrences. Increase readability.
disabled: true
- name: defer
# 7 occurrences. Confusing to read for newbies.
disabled: true
- name: confusing-naming
# 10 occurrences. Hurts readability.
disabled: true
- name: early-return
# 10 occurrences. Would improve readability.
disabled: true
- name: function-result-limit
# 12 occurrences (at default 3). A function returning many results is probably too big.
arguments: [7]
- name: function-length
# 155 occurrences (at default 0, 75). Really long functions should really be broken up in most cases.
arguments: [0, 500]
- name: cyclomatic
# 204 occurrences (at default 10)
arguments: [100]
- name: unhandled-error
# 222 occurrences. Could indicate failure to handle broken conditions.
disabled: true
- name: cognitive-complexity
arguments: [205]
# 441 occurrences (at default 7). We should try to lower it (involves significant refactoring).
##### P2: nice to have.
- name: max-public-structs
# 7 occurrences (at default 5). Might indicate overcrowding of public API.
arguments: [25]
- name: confusing-results
# 13 occurrences. Have named returns when the type stutters.
# Makes it a bit easier to figure out function behavior just looking at signature.
disabled: true
- name: comment-spacings
# 50 occurrences. Makes code look less wonky / ease readability.
disabled: true
- name: use-any
# 30 occurrences. `any` instead of `interface{}`. Cosmetic.
disabled: true
- name: empty-lines
# 85 occurrences. Makes code look less wonky / ease readability.
disabled: true
- name: package-comments
# 100 occurrences. Better for documentation...
disabled: true
- name: exported
# 577 occurrences. Forces documentation of any exported symbol.
disabled: true
###### Permanently disabled. Below have been reviewed and vetted to be unnecessary.
- name: line-length-limit
# Formatter `golines` takes care of this.
disabled: true
- name: nested-structs
# 5 occurrences. Trivial. This is not that hard to read.
disabled: true
- name: flag-parameter
# 52 occurrences. Not sure if this is valuable.
disabled: true
- name: unused-parameter
# 505 occurrences. A lot of work for a marginal improvement.
disabled: true
- name: unused-receiver
# 31 occurrences. Ibid.
disabled: true
- name: add-constant
# 2605 occurrences. Kind of useful in itself, but unacceptable amount of effort to fix
disabled: true
depguard:
rules:
no-patent:
# do not link in golang-lru anywhere (problematic patent)
deny:
- pkg: github.com/hashicorp/golang-lru/arc/v2
desc: patented (https://github.com/hashicorp/golang-lru/blob/arc/v2.0.7/arc/arc.go#L18)
pkg:
# pkg files must not depend on cobra nor anything in cmd
files:
- '**/pkg/**/*.go'
deny:
- pkg: github.com/spf13/cobra
desc: pkg must not depend on cobra
- pkg: github.com/spf13/pflag
desc: pkg must not depend on pflag
- pkg: github.com/spf13/viper
desc: pkg must not depend on viper
- pkg: github.com/containerd/nerdctl/v2/cmd
desc: pkg must not depend on any cmd files
gocritic:
disabled-checks:
# Below are normally enabled by default, but we do not pass
- appendAssign
- ifElseChain
- unslice
- badCall
- assignOp
- commentFormatting
- captLocal
- singleCaseSwitch
- wrapperFunc
- elseif
- regexpMust
enabled-checks:
# Below used to be enabled, but we do not pass anymore
# - paramTypeCombine
# - octalLiteral
# - unnamedResult
# - equalFold
# - sloppyReassign
# - emptyStringTest
# - hugeParam
# - appendCombine
# - stringXbytes
# - ptrToRefParam
# - commentedOutCode
# - rangeValCopy
# - methodExprCall
# - yodaStyleExpr
# - typeUnparen
# We enabled these and we pass
- nilValReturn
- weakCond
- indexAlloc
- rangeExprCopy
- boolExprSimplify
- commentedOutImport
- docStub
- emptyFallthrough
- hexLiteral
- typeAssertChain
- unlabelStmt
- builtinShadow
- importShadow
- initClause
- nestingReduce
- unnecessaryBlock
exclusions:
generated: disable
formatters:
settings:
gci:
sections:
- standard
- default
- prefix(github.com/containerd)
- localmodule
no-inline-comments: true
no-prefix-comments: true
custom-order: true
gofumpt:
extra-rules: true
golines:
max-len: 500
tab-len: 4
shorten-comments: true
enable:
- gci
- gofmt
# We might consider enabling the following:
# - gofumpt
- golines
exclusions:
generated: disable

22
BUILDING.md Normal file
View File

@ -0,0 +1,22 @@
# Building nerdctl
To build nerdctl, use `make`:
```bash
make
sudo make install
```
Alternatively, nerdctl can be also built with `go build ./cmd/nerdctl`.
However, this is not recommended as it does not populate the version string (`nerdctl -v`).
## Customization
To specify build tags, set the `BUILDTAGS` variable as follows:
```bash
BUILDTAGS=no_ipfs make
```
The following build tags are supported:
* `no_ipfs` (since v2.1.3): Disable IPFS

View File

@ -15,136 +15,145 @@
# -----------------------------------------------------------------------------
# Usage: `docker run -it --privileged <IMAGE>`. Make sure to add `-t` and `--privileged`.
# TODO: verify commit hash
# Basic deps
ARG CONTAINERD_VERSION=v2.0.0-rc.6
ARG RUNC_VERSION=v1.2.0
ARG CNI_PLUGINS_VERSION=v1.6.0
# @BINARY: the binary checksums are verified via Dockerfile.d/SHA256SUMS.d/<COMPONENT>-<VERSION>
ARG CONTAINERD_VERSION=v2.1.3@c787fb98911740dd3ff2d0e45ce88cdf01410486
ARG RUNC_VERSION=v1.3.0@4ca628d1d4c974f92d24daccb901aa078aad748e
ARG CNI_PLUGINS_VERSION=v1.7.1@BINARY
# Extra deps: Build
ARG BUILDKIT_VERSION=v0.16.0
ARG BUILDKIT_VERSION=v0.23.2@BINARY
# Extra deps: Lazy-pulling
ARG STARGZ_SNAPSHOTTER_VERSION=v0.15.1
ARG STARGZ_SNAPSHOTTER_VERSION=v0.16.3@BINARY
# Extra deps: Encryption
ARG IMGCRYPT_VERSION=v1.1.11
ARG IMGCRYPT_VERSION=v2.0.1@c377ec98ff79ec9205eabf555ebd2ea784738c6c
# Extra deps: Rootless
ARG ROOTLESSKIT_VERSION=v2.3.1
ARG SLIRP4NETNS_VERSION=v1.3.1
ARG ROOTLESSKIT_VERSION=v2.3.5@BINARY
ARG SLIRP4NETNS_VERSION=v1.3.3@BINARY
# Extra deps: bypass4netns
ARG BYPASS4NETNS_VERSION=v0.4.1
ARG BYPASS4NETNS_VERSION=v0.4.2@aa04bd3dcc48c6dae6d7327ba219bda8fe2a4634
# Extra deps: FUSE-OverlayFS
ARG FUSE_OVERLAYFS_VERSION=v1.14
ARG CONTAINERD_FUSE_OVERLAYFS_VERSION=v1.0.8
ARG FUSE_OVERLAYFS_VERSION=v1.15@BINARY
ARG CONTAINERD_FUSE_OVERLAYFS_VERSION=v2.1.6@BINARY
# Extra deps: Init
ARG TINI_VERSION=v0.19.0
ARG TINI_VERSION=v0.19.0@BINARY
# Extra deps: Debug
ARG BUILDG_VERSION=v0.4.1
ARG BUILDG_VERSION=v0.5.3@BINARY
# Extra deps: gomodjail
ARG GOMODJAIL_VERSION=v0.1.2@0a86b34442a491fa8f5e4565e9c846fce310239c
# Test deps
ARG GO_VERSION=1.23
# Currently, the Docker Official Images and the test deps are not pinned by the hash
ARG GO_VERSION=1.24
ARG UBUNTU_VERSION=24.04
ARG CONTAINERIZED_SYSTEMD_VERSION=v0.1.1
ARG GOTESTSUM_VERSION=v1.12.0
ARG NYDUS_VERSION=v2.3.0
ARG SOCI_SNAPSHOTTER_VERSION=0.7.0
ARG KUBO_VERSION=v0.31.0
ARG GOTESTSUM_VERSION=v1.12.3
ARG NYDUS_VERSION=v2.3.2
ARG SOCI_SNAPSHOTTER_VERSION=0.11.1
ARG KUBO_VERSION=v0.35.0
FROM --platform=$BUILDPLATFORM tonistiigi/xx:1.5.0 AS xx
FROM --platform=$BUILDPLATFORM tonistiigi/xx:1.6.1@sha256:923441d7c25f1e2eb5789f82d987693c47b8ed987c4ab3b075d6ed2b5d6779a3 AS xx
FROM --platform=$BUILDPLATFORM golang:${GO_VERSION}-bookworm AS build-base-debian
FROM --platform=$BUILDPLATFORM golang:${GO_VERSION}-bookworm AS build-base
COPY --from=xx / /
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update -qq && apt-get install -qq --no-install-recommends \
git \
dpkg-dev
make \
git \
jq \
curl \
dpkg-dev
ARG TARGETARCH
# libbtrfs: for containerd
# libseccomp: for runc and bypass4netns
RUN xx-apt-get update -qq && xx-apt-get install -qq --no-install-recommends \
binutils \
gcc \
libc6-dev \
libbtrfs-dev \
libseccomp-dev \
pkg-config
binutils \
gcc \
libc6-dev \
libbtrfs-dev \
libseccomp-dev \
pkg-config
RUN git config --global advice.detachedHead false
ADD hack/git-checkout-tag-with-hash.sh /usr/local/bin/
ADD hack/scripts/lib.sh /usr/local/bin/http::helper
FROM build-base-debian AS build-containerd
FROM build-base AS build-containerd
ARG TARGETARCH
ARG CONTAINERD_VERSION
RUN git clone https://github.com/containerd/containerd.git /go/src/github.com/containerd/containerd
RUN git clone --quiet --depth 1 --branch "${CONTAINERD_VERSION%%@*}" https://github.com/containerd/containerd.git /go/src/github.com/containerd/containerd
WORKDIR /go/src/github.com/containerd/containerd
RUN git checkout ${CONTAINERD_VERSION} && \
RUN git-checkout-tag-with-hash.sh ${CONTAINERD_VERSION} && \
mkdir -p /out /out/$TARGETARCH && \
cp -a containerd.service /out
RUN GO=xx-go make STATIC=1 && \
cp -a bin/containerd bin/containerd-shim-runc-v2 bin/ctr /out/$TARGETARCH
FROM build-base-debian AS build-runc
FROM build-base AS build-runc
ARG RUNC_VERSION
ARG TARGETARCH
RUN git clone https://github.com/opencontainers/runc.git /go/src/github.com/opencontainers/runc
RUN git clone --quiet --depth 1 --branch "${RUNC_VERSION%%@*}" https://github.com/opencontainers/runc.git /go/src/github.com/opencontainers/runc
WORKDIR /go/src/github.com/opencontainers/runc
RUN git checkout ${RUNC_VERSION} && \
RUN git-checkout-tag-with-hash.sh ${RUNC_VERSION} && \
mkdir -p /out
ENV CGO_ENABLED=1
RUN GO=xx-go CC=$(xx-info)-gcc STRIP=$(xx-info)-strip make static && \
xx-verify --static runc && cp -v -a runc /out/runc.${TARGETARCH}
FROM build-base-debian AS build-bypass4netns
FROM build-base AS build-bypass4netns
ARG BYPASS4NETNS_VERSION
ARG TARGETARCH
RUN git clone https://github.com/rootless-containers/bypass4netns.git /go/src/github.com/rootless-containers/bypass4netns
RUN git clone --quiet --depth 1 --branch "${BYPASS4NETNS_VERSION%%@*}" https://github.com/rootless-containers/bypass4netns.git /go/src/github.com/rootless-containers/bypass4netns
WORKDIR /go/src/github.com/rootless-containers/bypass4netns
RUN git checkout ${BYPASS4NETNS_VERSION} && \
RUN git-checkout-tag-with-hash.sh ${BYPASS4NETNS_VERSION} && \
mkdir -p /out/${TARGETARCH}
ENV CGO_ENABLED=1
RUN GO=xx-go make static && \
xx-verify --static bypass4netns && cp -a bypass4netns bypass4netnsd /out/${TARGETARCH}
FROM build-base-debian AS build-kubo
FROM build-base AS build-gomodjail
ARG GOMODJAIL_VERSION
ARG TARGETARCH
RUN git clone --quiet --depth 1 --branch "${GOMODJAIL_VERSION%%@*}" https://github.com/AkihiroSuda/gomodjail.git /go/src/github.com/AkihiroSuda/gomodjail
WORKDIR /go/src/github.com/AkihiroSuda/gomodjail
RUN git-checkout-tag-with-hash.sh ${GOMODJAIL_VERSION} && \
mkdir -p /out/${TARGETARCH}
RUN GO=xx-go make STATIC=1 && \
xx-verify --static _output/bin/gomodjail && cp -a _output/bin/gomodjail /out/${TARGETARCH}
FROM build-base AS build-kubo
ARG KUBO_VERSION
ARG TARGETARCH
RUN git clone https://github.com/ipfs/kubo.git /go/src/github.com/ipfs/kubo
RUN git clone --quiet --depth 1 --branch "${KUBO_VERSION%%@*}" https://github.com/ipfs/kubo.git /go/src/github.com/ipfs/kubo
WORKDIR /go/src/github.com/ipfs/kubo
RUN git checkout ${KUBO_VERSION} && \
RUN git-checkout-tag-with-hash.sh ${KUBO_VERSION} && \
mkdir -p /out/${TARGETARCH}
ENV CGO_ENABLED=0
RUN xx-go --wrap && \
make build && \
xx-verify --static cmd/ipfs/ipfs && cp -a cmd/ipfs/ipfs /out/${TARGETARCH}
FROM --platform=$BUILDPLATFORM golang:${GO_VERSION}-alpine AS build-base
RUN apk add --no-cache make git curl
COPY . /go/src/github.com/containerd/nerdctl
WORKDIR /go/src/github.com/containerd/nerdctl
FROM build-base AS build-minimal
RUN BINDIR=/out/bin make binaries install
# We do not set CMD to `go test` here, because it requires systemd
FROM build-base AS build-full
FROM build-base AS build-dependencies
ARG TARGETARCH
ENV GOARCH=${TARGETARCH}
RUN BINDIR=/out/bin make binaries install
WORKDIR /nowhere
COPY ./Dockerfile.d/SHA256SUMS.d/ /SHA256SUMS.d
COPY README.md /out/share/doc/nerdctl/
COPY docs /out/share/doc/nerdctl/docs
WORKDIR /nowhere
RUN echo "${TARGETARCH:-amd64}" | sed -e s/amd64/x86_64/ -e s/arm64/aarch64/ | tee /target_uname_m
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/containerd/nerdctl && git describe --tags)" >> /out/share/doc/nerdctl-full/README.md
RUN mkdir -p /out/share/doc/nerdctl-full && touch /out/share/doc/nerdctl-full/README.md
ARG CONTAINERD_VERSION
COPY --from=build-containerd /out/${TARGETARCH:-amd64}/* /out/bin/
COPY --from=build-containerd /out/containerd.service /out/lib/systemd/system/containerd.service
RUN echo "- containerd: ${CONTAINERD_VERSION}" >> /out/share/doc/nerdctl-full/README.md
RUN echo "- containerd: ${CONTAINERD_VERSION%%@*}" >> /out/share/doc/nerdctl-full/README.md
ARG RUNC_VERSION
COPY --from=build-runc /out/runc.${TARGETARCH:-amd64} /out/bin/runc
RUN echo "- runc: ${RUNC_VERSION}" >> /out/share/doc/nerdctl-full/README.md
RUN echo "- runc: ${RUNC_VERSION%%@*}" >> /out/share/doc/nerdctl-full/README.md
ARG CNI_PLUGINS_VERSION
RUN fname="cni-plugins-${TARGETOS:-linux}-${TARGETARCH:-amd64}-${CNI_PLUGINS_VERSION}.tgz" && \
RUN CNI_PLUGINS_VERSION=${CNI_PLUGINS_VERSION%%@*}; \
fname="cni-plugins-${TARGETOS:-linux}-${TARGETARCH:-amd64}-${CNI_PLUGINS_VERSION}.tgz" && \
curl -o "${fname}" -fsSL --proto '=https' --tlsv1.2 "https://github.com/containernetworking/plugins/releases/download/${CNI_PLUGINS_VERSION}/${fname}" && \
grep "${fname}" "/SHA256SUMS.d/cni-plugins-${CNI_PLUGINS_VERSION}" | sha256sum -c && \
mkdir -p /out/libexec/cni && \
@ -152,7 +161,8 @@ RUN fname="cni-plugins-${TARGETOS:-linux}-${TARGETARCH:-amd64}-${CNI_PLUGINS_VER
rm -f "${fname}" && \
echo "- CNI plugins: ${CNI_PLUGINS_VERSION}" >> /out/share/doc/nerdctl-full/README.md
ARG BUILDKIT_VERSION
RUN fname="buildkit-${BUILDKIT_VERSION}.${TARGETOS:-linux}-${TARGETARCH:-amd64}.tar.gz" && \
RUN BUILDKIT_VERSION=${BUILDKIT_VERSION%%@*}; \
fname="buildkit-${BUILDKIT_VERSION}.${TARGETOS:-linux}-${TARGETARCH:-amd64}.tar.gz" && \
curl -o "${fname}" -fsSL --proto '=https' --tlsv1.2 "https://github.com/moby/buildkit/releases/download/${BUILDKIT_VERSION}/${fname}" && \
grep "${fname}" "/SHA256SUMS.d/buildkit-${BUILDKIT_VERSION}" | sha256sum -c && \
tar xzf "${fname}" -C /out && \
@ -166,9 +176,11 @@ RUN cd /out/lib/systemd/system && \
echo "" >> buildkit.service && \
echo "# This file was converted from containerd.service, with \`sed -E '${sedcomm}'\`" >> buildkit.service
ARG STARGZ_SNAPSHOTTER_VERSION
RUN fname="stargz-snapshotter-${STARGZ_SNAPSHOTTER_VERSION}-${TARGETOS:-linux}-${TARGETARCH:-amd64}.tar.gz" && \
RUN --mount=type=secret,id=github_token,env=GITHUB_TOKEN \
STARGZ_SNAPSHOTTER_VERSION=${STARGZ_SNAPSHOTTER_VERSION%%@*}; \
fname="stargz-snapshotter-${STARGZ_SNAPSHOTTER_VERSION}-${TARGETOS:-linux}-${TARGETARCH:-amd64}.tar.gz" && \
curl -o "${fname}" -fsSL --proto '=https' --tlsv1.2 "https://github.com/containerd/stargz-snapshotter/releases/download/${STARGZ_SNAPSHOTTER_VERSION}/${fname}" && \
curl -o "stargz-snapshotter.service" -fsSL --proto '=https' --tlsv1.2 "https://raw.githubusercontent.com/containerd/stargz-snapshotter/${STARGZ_SNAPSHOTTER_VERSION}/script/config/etc/systemd/system/stargz-snapshotter.service" && \
http::helper github::file containerd/stargz-snapshotter script/config/etc/systemd/system/stargz-snapshotter.service "${STARGZ_SNAPSHOTTER_VERSION}" > "stargz-snapshotter.service" && \
grep "${fname}" "/SHA256SUMS.d/stargz-snapshotter-${STARGZ_SNAPSHOTTER_VERSION}" | sha256sum -c - && \
grep "stargz-snapshotter.service" "/SHA256SUMS.d/stargz-snapshotter-${STARGZ_SNAPSHOTTER_VERSION}" | sha256sum -c - && \
tar xzf "${fname}" -C /out/bin && \
@ -176,20 +188,14 @@ RUN fname="stargz-snapshotter-${STARGZ_SNAPSHOTTER_VERSION}-${TARGETOS:-linux}-$
mv stargz-snapshotter.service /out/lib/systemd/system/stargz-snapshotter.service && \
echo "- Stargz Snapshotter: ${STARGZ_SNAPSHOTTER_VERSION}" >> /out/share/doc/nerdctl-full/README.md
ARG IMGCRYPT_VERSION
RUN git clone https://github.com/containerd/imgcrypt.git /go/src/github.com/containerd/imgcrypt && \
RUN git clone --quiet --depth 1 --branch "${IMGCRYPT_VERSION%%@*}" https://github.com/containerd/imgcrypt.git /go/src/github.com/containerd/imgcrypt && \
cd /go/src/github.com/containerd/imgcrypt && \
git checkout "${IMGCRYPT_VERSION}" && \
git-checkout-tag-with-hash.sh "${IMGCRYPT_VERSION}" && \
CGO_ENABLED=0 make && DESTDIR=/out make install && \
echo "- imgcrypt: ${IMGCRYPT_VERSION}" >> /out/share/doc/nerdctl-full/README.md
ARG ROOTLESSKIT_VERSION
RUN fname="rootlesskit-$(cat /target_uname_m).tar.gz" && \
curl -o "${fname}" -fsSL --proto '=https' --tlsv1.2 "https://github.com/rootless-containers/rootlesskit/releases/download/${ROOTLESSKIT_VERSION}/${fname}" && \
grep "${fname}" "/SHA256SUMS.d/rootlesskit-${ROOTLESSKIT_VERSION}" | sha256sum -c && \
tar xzf "${fname}" -C /out/bin && \
rm -f "${fname}" /out/bin/rootlesskit-docker-proxy && \
echo "- RootlessKit: ${ROOTLESSKIT_VERSION}" >> /out/share/doc/nerdctl-full/README.md
echo "- imgcrypt: ${IMGCRYPT_VERSION%%@*}" >> /out/share/doc/nerdctl-full/README.md
ARG SLIRP4NETNS_VERSION
RUN fname="slirp4netns-$(cat /target_uname_m)" && \
RUN SLIRP4NETNS_VERSION=${SLIRP4NETNS_VERSION%%@*}; \
fname="slirp4netns-$(cat /target_uname_m)" && \
curl -o "${fname}" -fsSL --proto '=https' --tlsv1.2 "https://github.com/rootless-containers/slirp4netns/releases/download/${SLIRP4NETNS_VERSION}/${fname}" && \
grep "${fname}" "/SHA256SUMS.d/slirp4netns-${SLIRP4NETNS_VERSION}" | sha256sum -c && \
mv "${fname}" /out/bin/slirp4netns && \
@ -197,43 +203,76 @@ RUN fname="slirp4netns-$(cat /target_uname_m)" && \
echo "- slirp4netns: ${SLIRP4NETNS_VERSION}" >> /out/share/doc/nerdctl-full/README.md
ARG BYPASS4NETNS_VERSION
COPY --from=build-bypass4netns /out/${TARGETARCH:-amd64}/* /out/bin/
RUN echo "- bypass4netns: ${BYPASS4NETNS_VERSION}" >> /out/share/doc/nerdctl-full/README.md
RUN echo "- bypass4netns: ${BYPASS4NETNS_VERSION%%@*}" >> /out/share/doc/nerdctl-full/README.md
ARG FUSE_OVERLAYFS_VERSION
RUN fname="fuse-overlayfs-$(cat /target_uname_m)" && \
RUN FUSE_OVERLAYFS_VERSION=${FUSE_OVERLAYFS_VERSION%%@*}; \
fname="fuse-overlayfs-$(cat /target_uname_m)" && \
curl -o "${fname}" -fsSL --proto '=https' --tlsv1.2 "https://github.com/containers/fuse-overlayfs/releases/download/${FUSE_OVERLAYFS_VERSION}/${fname}" && \
grep "${fname}" "/SHA256SUMS.d/fuse-overlayfs-${FUSE_OVERLAYFS_VERSION}" | sha256sum -c && \
mv "${fname}" /out/bin/fuse-overlayfs && \
chmod +x /out/bin/fuse-overlayfs && \
echo "- fuse-overlayfs: ${FUSE_OVERLAYFS_VERSION}" >> /out/share/doc/nerdctl-full/README.md
ARG CONTAINERD_FUSE_OVERLAYFS_VERSION
RUN fname="containerd-fuse-overlayfs-${CONTAINERD_FUSE_OVERLAYFS_VERSION/v}-${TARGETOS:-linux}-${TARGETARCH:-amd64}.tar.gz" && \
RUN CONTAINERD_FUSE_OVERLAYFS_VERSION=${CONTAINERD_FUSE_OVERLAYFS_VERSION%%@*}; \
fname="containerd-fuse-overlayfs-${CONTAINERD_FUSE_OVERLAYFS_VERSION##*v}-${TARGETOS:-linux}-${TARGETARCH:-amd64}.tar.gz" && \
curl -o "${fname}" -fsSL --proto '=https' --tlsv1.2 "https://github.com/containerd/fuse-overlayfs-snapshotter/releases/download/${CONTAINERD_FUSE_OVERLAYFS_VERSION}/${fname}" && \
grep "${fname}" "/SHA256SUMS.d/containerd-fuse-overlayfs-${CONTAINERD_FUSE_OVERLAYFS_VERSION}" | sha256sum -c && \
tar xzf "${fname}" -C /out/bin && \
rm -f "${fname}" && \
echo "- containerd-fuse-overlayfs: ${CONTAINERD_FUSE_OVERLAYFS_VERSION}" >> /out/share/doc/nerdctl-full/README.md
ARG TINI_VERSION
RUN fname="tini-static-${TARGETARCH:-amd64}" && \
RUN TINI_VERSION=${TINI_VERSION%%@*}; \
fname="tini-static-${TARGETARCH:-amd64}" && \
curl -o "${fname}" -fsSL --proto '=https' --tlsv1.2 "https://github.com/krallin/tini/releases/download/${TINI_VERSION}/${fname}" && \
grep "${fname}" "/SHA256SUMS.d/tini-${TINI_VERSION}" | sha256sum -c && \
cp -a "${fname}" /out/bin/tini && chmod +x /out/bin/tini && \
echo "- Tini: ${TINI_VERSION}" >> /out/share/doc/nerdctl-full/README.md
ARG BUILDG_VERSION
RUN fname="buildg-${BUILDG_VERSION}-${TARGETOS:-linux}-${TARGETARCH:-amd64}.tar.gz" && \
# FIXME: this is a mildly-confusing approach. Buildkit will perform some "smart" replacement at build time and output
# confusing debugging information, eg: BUILDG_VERSION will appear as if the original ARG value was used.
RUN BUILDG_VERSION=${BUILDG_VERSION%%@*}; \
fname="buildg-${BUILDG_VERSION}-${TARGETOS:-linux}-${TARGETARCH:-amd64}.tar.gz" && \
curl -o "${fname}" -fsSL --proto '=https' --tlsv1.2 "https://github.com/ktock/buildg/releases/download/${BUILDG_VERSION}/${fname}" && \
grep "${fname}" "/SHA256SUMS.d/buildg-${BUILDG_VERSION}" | sha256sum -c && \
tar xzf "${fname}" -C /out/bin && \
rm -f "${fname}" && \
echo "- buildg: ${BUILDG_VERSION}" >> /out/share/doc/nerdctl-full/README.md
ARG ROOTLESSKIT_VERSION
RUN ROOTLESSKIT_VERSION=${ROOTLESSKIT_VERSION%%@*}; \
fname="rootlesskit-$(cat /target_uname_m).tar.gz" && \
curl -o "${fname}" -fsSL --proto '=https' --tlsv1.2 "https://github.com/rootless-containers/rootlesskit/releases/download/${ROOTLESSKIT_VERSION}/${fname}" && \
grep "${fname}" "/SHA256SUMS.d/rootlesskit-${ROOTLESSKIT_VERSION}" | sha256sum -c && \
tar xzf "${fname}" -C /out/bin && \
rm -f "${fname}" /out/bin/rootlesskit-docker-proxy && \
echo "- RootlessKit: ${ROOTLESSKIT_VERSION}" >> /out/share/doc/nerdctl-full/README.md
ARG GOMODJAIL_VERSION
COPY --from=build-gomodjail /out/${TARGETARCH:-amd64}/* /out/bin/
RUN echo "- gomodjail: ${GOMODJAIL_VERSION}" >> /out/share/doc/nerdctl-full/README.md
ARG CONTAINERIZED_SYSTEMD_VERSION
RUN --mount=type=secret,id=github_token,env=GITHUB_TOKEN \
http::helper github::file AkihiroSuda/containerized-systemd docker-entrypoint.sh "${CONTAINERIZED_SYSTEMD_VERSION}" > /docker-entrypoint.sh && \
chmod +x /docker-entrypoint.sh
RUN echo "" >> /out/share/doc/nerdctl-full/README.md && \
echo "## License" >> /out/share/doc/nerdctl-full/README.md && \
echo "- bin/slirp4netns: [GNU GENERAL PUBLIC LICENSE, Version 2](https://github.com/rootless-containers/slirp4netns/blob/${SLIRP4NETNS_VERSION}/COPYING)" >> /out/share/doc/nerdctl-full/README.md && \
echo "- bin/fuse-overlayfs: [GNU GENERAL PUBLIC LICENSE, Version 2](https://github.com/containers/fuse-overlayfs/blob/${FUSE_OVERLAYFS_VERSION}/COPYING)" >> /out/share/doc/nerdctl-full/README.md && \
echo "- bin/slirp4netns: [GNU GENERAL PUBLIC LICENSE, Version 2](https://github.com/rootless-containers/slirp4netns/blob/${SLIRP4NETNS_VERSION%%@*}/COPYING)" >> /out/share/doc/nerdctl-full/README.md && \
echo "- bin/fuse-overlayfs: [GNU GENERAL PUBLIC LICENSE, Version 2](https://github.com/containers/fuse-overlayfs/blob/${FUSE_OVERLAYFS_VERSION%%@*}/COPYING)" >> /out/share/doc/nerdctl-full/README.md && \
echo "- bin/{runc,bypass4netns,bypass4netnsd}: Apache License 2.0, statically linked with libseccomp ([LGPL 2.1](https://github.com/seccomp/libseccomp/blob/main/LICENSE), source code available at https://github.com/seccomp/libseccomp/)" >> /out/share/doc/nerdctl-full/README.md && \
echo "- bin/tini: [MIT License](https://github.com/krallin/tini/blob/${TINI_VERSION}/LICENSE)" >> /out/share/doc/nerdctl-full/README.md && \
echo "- Other files: [Apache License 2.0](https://www.apache.org/licenses/LICENSE-2.0)" >> /out/share/doc/nerdctl-full/README.md && \
(cd /out && find ! -type d | sort | xargs sha256sum > /tmp/SHA256SUMS ) && \
echo "- bin/tini: [MIT License](https://github.com/krallin/tini/blob/${TINI_VERSION%%@*}/LICENSE)" >> /out/share/doc/nerdctl-full/README.md && \
echo "- Other files: [Apache License 2.0](https://www.apache.org/licenses/LICENSE-2.0)" >> /out/share/doc/nerdctl-full/README.md
FROM build-dependencies AS build-full
COPY . /go/src/github.com/containerd/nerdctl
RUN { echo "# nerdctl (full distribution)"; echo "- nerdctl: $(cd /go/src/github.com/containerd/nerdctl && git describe --tags)"; cat /out/share/doc/nerdctl-full/README.md; } > /out/share/doc/nerdctl-full/README.md.new; mv /out/share/doc/nerdctl-full/README.md.new /out/share/doc/nerdctl-full/README.md
WORKDIR /go/src/github.com/containerd/nerdctl
RUN BINDIR=/out/bin make binaries install
# FIXME: `gomodjail pack` depends on QEMU for non-native architecture
# TODO: gomodjail should provide a plain shell script that utilizes `zip(1)` for packing the self-extract archive, without running `gomodjail pack`..
RUN /out/bin/gomodjail pack --go-mod=/go/src/github.com/containerd/nerdctl/go.mod /out/bin/nerdctl && \
cp -a nerdctl.gomodjail /out/bin/
COPY README.md /out/share/doc/nerdctl/
COPY docs /out/share/doc/nerdctl/docs
RUN (cd /out && find ! -type d | sort | xargs sha256sum > /tmp/SHA256SUMS ) && \
mv /tmp/SHA256SUMS /out/share/doc/nerdctl-full/SHA256SUMS && \
chown -R 0:0 /out
@ -243,15 +282,13 @@ COPY --from=build-full /out /
FROM ubuntu:${UBUNTU_VERSION} AS base
# fuse3 is required by stargz snapshotter
RUN apt-get update -qq && apt-get install -qq -y --no-install-recommends \
apparmor \
bash-completion \
ca-certificates curl \
iproute2 iptables \
dbus dbus-user-session systemd systemd-sysv \
fuse3
ARG CONTAINERIZED_SYSTEMD_VERSION
RUN curl -o /docker-entrypoint.sh -fsSL --proto '=https' --tlsv1.2 https://raw.githubusercontent.com/AkihiroSuda/containerized-systemd/${CONTAINERIZED_SYSTEMD_VERSION}/docker-entrypoint.sh && \
chmod +x /docker-entrypoint.sh
apparmor \
bash-completion \
ca-certificates curl \
iproute2 iptables \
dbus dbus-user-session systemd systemd-sysv \
fuse3
COPY --from=build-full /docker-entrypoint.sh /docker-entrypoint.sh
COPY --from=out-full / /usr/local/
RUN perl -pi -e 's/multi-user.target/docker-entrypoint.target/g' /usr/local/lib/systemd/system/*.service && \
systemctl enable containerd buildkit stargz-snapshotter && \
@ -267,20 +304,18 @@ VOLUME /var/lib/nerdctl
ENTRYPOINT ["/docker-entrypoint.sh"]
CMD ["bash", "--login", "-i"]
# convert GO_VERSION=1.16 to the latest release such as "go1.16.1"
FROM golang:${GO_VERSION}-alpine AS goversion
RUN go env GOVERSION > /GOVERSION
FROM base AS test-integration
ARG DEBIAN_FRONTEND=noninteractive
# `expect` package contains `unbuffer(1)`, which is used for emulating TTY for testing
# `jq` is required to generate test summaries
RUN apt-get update -qq && apt-get install -qq --no-install-recommends \
expect \
git \
make
COPY --from=goversion /GOVERSION /GOVERSION
expect \
jq \
git \
make
# We wouldn't need this if Docker Hub could have "golang:${GO_VERSION}-ubuntu"
COPY --from=build-base /usr/local/go /usr/local/go
ARG TARGETARCH
RUN curl -fsSL --proto '=https' --tlsv1.2 https://golang.org/dl/$(cat /GOVERSION).linux-${TARGETARCH:-amd64}.tar.gz | tar xzvC /usr/local
ENV PATH=/usr/local/go/bin:$PATH
ARG GOTESTSUM_VERSION
RUN GOBIN=/usr/local/bin go install gotest.tools/gotestsum@${GOTESTSUM_VERSION}
@ -294,7 +329,10 @@ COPY --from=ghcr.io/sigstore/cosign/cosign:v2.2.3@sha256:8fc9cad121611e8479f65f7
ARG SOCI_SNAPSHOTTER_VERSION
RUN fname="soci-snapshotter-${SOCI_SNAPSHOTTER_VERSION}-${TARGETOS:-linux}-${TARGETARCH:-amd64}.tar.gz" && \
curl -o "${fname}" -fsSL --proto '=https' --tlsv1.2 "https://github.com/awslabs/soci-snapshotter/releases/download/v${SOCI_SNAPSHOTTER_VERSION}/${fname}" && \
tar -C /usr/local/bin -xvf "${fname}" soci soci-snapshotter-grpc
tar -C /usr/local/bin -xvf "${fname}" soci soci-snapshotter-grpc && \
mkdir -p /etc/soci-snapshotter-grpc && \
touch /etc/soci-snapshotter-grpc/config.toml && \
echo "\n[pull_modes]\n [pull_modes.soci_v1]\n enable = true" >> /etc/soci-snapshotter-grpc/config.toml
# enable offline ipfs for integration test
COPY --from=build-kubo /out/${TARGETARCH:-amd64}/* /usr/local/bin/
COPY ./Dockerfile.d/test-integration-etc_containerd-stargz-grpc_config.toml /etc/containerd-stargz-grpc/config.toml
@ -322,9 +360,9 @@ FROM test-integration AS test-integration-rootless
# (`sudo` does not work for this purpose,
# OTOH `machinectl shell` can create the session but does not propagate exit code)
RUN apt-get update -qq && apt-get install -qq --no-install-recommends \
uidmap \
openssh-server \
openssh-client
uidmap \
openssh-server \
openssh-client
# TODO: update containerized-systemd to enable sshd by default, or allow `systemctl wants <TARGET> ssh` here
RUN ssh-keygen -q -t rsa -f /root/.ssh/id_rsa -N '' && \
useradd -m -s /bin/bash rootless && \

View File

@ -1,2 +0,0 @@
87d047c4742b904e9f0f48427aec5cd157dc96ea97cd89e3ff5b1db171c6eb5e buildg-v0.4.1-linux-amd64.tar.gz
44ab3251cef95f0e79e94f54113be962dacf197ad8d5c5b455aa4a6b8d566111 buildg-v0.4.1-linux-arm64.tar.gz

View File

@ -0,0 +1,4 @@
cf4c40c58ca795eeb6e75e2c6a0e5bb3a6a9c0623d51bc3b85163e5d483eeade buildg-full-v0.5.3-linux-amd64.tar.gz
47c479f2e5150c9c76294fa93a03ad20e5928f4315bf52ca8432bfb6707d4276 buildg-full-v0.5.3-linux-arm64.tar.gz
c289a454ae8673ff99acf56dec9ba97274c20d2015e80f7ac3b8eb8e4f77888f buildg-v0.5.3-linux-amd64.tar.gz
b2e244250ce7ea5c090388f2025a9c546557861d25bba7b0666aa512f01fa6cd buildg-v0.5.3-linux-arm64.tar.gz

View File

@ -1,2 +0,0 @@
a07a01da821d39bdb6e03a2f98ee407bb861cc61ece2e69e2ea4d61b3a4ab7f1 buildkit-v0.16.0.linux-amd64.tar.gz
1b70bb7955ddda66537d4bf9aa540e79e79e19aa989901613da58f5f133a53ef buildkit-v0.16.0.linux-arm64.tar.gz

View File

@ -0,0 +1,2 @@
2771c3403e3a1f75a83cde387a05365794d3b900c355e864772a36c3ce541f82 buildkit-v0.23.2.linux-amd64.tar.gz
6385ff70b2fb4134b50ac3183eea3a0b06c6f6129173940d73178ae0477368f1 buildkit-v0.23.2.linux-arm64.tar.gz

View File

@ -1,2 +0,0 @@
682b49ff8933a997a52107161f1745f8312364b4c7f605ccdf7a77499130d89d cni-plugins-linux-amd64-v1.6.0.tgz
db09ab057ecf60b05ba05cbec38d55b95cc139c7f1078e2e4857cc13af158cee cni-plugins-linux-arm64-v1.6.0.tgz

View File

@ -0,0 +1,2 @@
1a28a0506bfe5bcdc981caf1a49eeab7e72da8321f1119b7be85f22621013098 cni-plugins-linux-amd64-v1.7.1.tgz
119fcb508d1ac2149e49a550752f9cd64d023a1d70e189b59c476e4d2bf7c497 cni-plugins-linux-arm64-v1.7.1.tgz

View File

@ -1,6 +0,0 @@
a831f236299007bd1078e49df2e45ad0aeee47c5ed099852ad5f6791b091d536 containerd-fuse-overlayfs-1.0.8-linux-amd64.tar.gz
d0fd1fd92ee9ef03050aa759f197b50c46bca81a75bed65b4433b6213a145022 containerd-fuse-overlayfs-1.0.8-linux-arm-v7.tar.gz
17a3a83ae92002dce8ebe41e6a10877ac5d417550d63939c74fc22b0be6ca04a containerd-fuse-overlayfs-1.0.8-linux-arm64.tar.gz
dddaea552594166eb4edef8adabe765b2fae099574b7afe47657fc87674c81db containerd-fuse-overlayfs-1.0.8-linux-ppc64le.tar.gz
d6846b4bf1500cc2dbd29e382ba8b1f2268bdbfc5358a48d17131b8108f97aa9 containerd-fuse-overlayfs-1.0.8-linux-riscv64.tar.gz
492ce81ed25a9b8b3c64d807d3e0f7de6011e70dc11915df8aef64a77fa67fb9 containerd-fuse-overlayfs-1.0.8-linux-s390x.tar.gz

View File

@ -0,0 +1,6 @@
8a768e4c953251d32b5e5d748d17593f7150834caaba403b483cf83f5856fea3 containerd-fuse-overlayfs-2.1.6-linux-amd64.tar.gz
a3af866a12e913cd1d4dda8e41c08345eca928a15ac1d466fdb2b00b013e14ee containerd-fuse-overlayfs-2.1.6-linux-arm-v7.tar.gz
417ca0c838e43e446f498b384d73f7caaeb00dc4c1c0fe4b0ecfdd36fd355daa containerd-fuse-overlayfs-2.1.6-linux-arm64.tar.gz
5fdebd9fb7b50473318f0410bc3ab46f3388ac8aa586b45c91a314af9ce6569c containerd-fuse-overlayfs-2.1.6-linux-ppc64le.tar.gz
7e1a9d2ba68ff31a8dfb53bf6e71b2879063b13c759922c8cff3013893829bca containerd-fuse-overlayfs-2.1.6-linux-riscv64.tar.gz
3c022651cdaff666e88996d5d9c7e776bf59419a03d7d718a28aa708036419f9 containerd-fuse-overlayfs-2.1.6-linux-s390x.tar.gz

View File

@ -1,2 +0,0 @@
bf2c19b80e68afe1f53bae7a08cc9e7fb2f1b49bfdb9e5b49ab87cbe80b97cd1 fuse-overlayfs-aarch64
4817a8896a9e6f0433080f88f5b71dec931e8829a89d64c71af94b0630ccb4a9 fuse-overlayfs-x86_64

View File

@ -0,0 +1,6 @@
a62829baa7a7d39d0a9a784d51ebd528efe226192c0a86ba6667d0fcae9129c3 fuse-overlayfs-aarch64
7ad67a810100bebf63c41fbb621df3d552531db94d600a94f5f701b1e9f8aa5a fuse-overlayfs-armv7l
9778e1f0da1429469bcc65ea90a7504e63f0a258089b9bb1ae65105330e61808 fuse-overlayfs-ppc64le
f7a2852983b3d0a8f15c31084c215b4965d5b62b9ce1014708283dd2dd909b28 fuse-overlayfs-riscv64
89a410a67822002c20ff21d8a9e5353ebda00d3a2f79fd99f26fb47533e253a5 fuse-overlayfs-s390x
1cd97f5ca7ac52fa192c94c1e605713cfb27d3dc417c0bef4dcfb9fb20e01e81 fuse-overlayfs-x86_64

View File

@ -1,6 +0,0 @@
57bc67f71b8043961417325be13528d4f1e8ec90876cd34c38064431f457070f rootlesskit-aarch64.tar.gz
5154542509736957738478e3624b53865a875c396f978db5adea513d7507dee6 rootlesskit-armv7l.tar.gz
983642556dd3dcbe2c9b764d577882016ad1ca960815ffa13ca76d7da518504f rootlesskit-ppc64le.tar.gz
83c40bb8938828eb15837a4900ba825a1f52227631195c22df85f2e8f7f73546 rootlesskit-riscv64.tar.gz
dd6c8bc7e1c9b5d8c775efcf40854ef1d25205060294f0654a77d996a7f4e172 rootlesskit-s390x.tar.gz
caafdce18e0959f078b4b478d4f352ebf3d556e373265fc7831f1a6d70219ee0 rootlesskit-x86_64.tar.gz

View File

@ -0,0 +1,6 @@
478c14c3195bf989cd9a8e6bd129d227d5d88f1c11418967ffdc84a0072cc7a2 rootlesskit-aarch64.tar.gz
0622e52952a848219b86b902c9bdb96e1ebe575a3015c05e7da02569e83b3a61 rootlesskit-armv7l.tar.gz
b1ec12321c54860230c5d0bbbc6d651a746ac49bce7eeb36fd1ad1e0f0048d58 rootlesskit-ppc64le.tar.gz
8ee59e518cdb5770afab49307b400f585598ed2c06b4ffc81f7c36fbeea422d6 rootlesskit-riscv64.tar.gz
2a3198947cf322357106557c58a8d5f29a664961edf290ea305c94b03521f6c8 rootlesskit-s390x.tar.gz
118208e25becd144ee7317c172fc9decce7b16174d5c1bbf80f1d1d0eacc6b5f rootlesskit-x86_64.tar.gz

View File

@ -1,6 +0,0 @@
2dd9aac6c2e3203e53cb7b6e4b9fc7123e4e4a9716c8bb1d95951853059a6af5 slirp4netns-aarch64
ed618c0f2c74014bb736e9e427e18c8791ad9d68311872a41b06fac0d7cb9ef2 slirp4netns-armv7l
a10f70209cee0dd0532fea0e8b6bfde5d16dec5206fd4b3387d861721456de66 slirp4netns-ppc64le
38209015c2f3f4619d9fc46610852887910f33c7a0b96f7d2aa835a7bbc73f31 slirp4netns-riscv64
9f42718455b1f9cf4b6f0efee314b78e860b8c36dbbb6290f09c8fbedda9ff8a slirp4netns-s390x
4bc5d6c311f9fa7ae00ce54aefe10c2afaf0800fe9e99f32616a964ed804a9e1 slirp4netns-x86_64

View File

@ -0,0 +1,7 @@
d0e6a13342efbedb8b7454629a0e9ce9b7a937c261034c85f46ed81af76307d8 SOURCE_DATE_EPOCH
1ca9d2f5f1fb4beb91f354653e5dad35b95c049afb264268d99a96ff2a10d903 slirp4netns-aarch64
3e209d1c56fccbe627a038d311b233c15e8d914b30f9b981b5ed78b98e836859 slirp4netns-armv7l
4d1003a98103ee170c0fcd4aad8a5e0ba7aa2e70fbca883cbb6a39f40447c8da slirp4netns-ppc64le
06a13b398d88120097b20dace966d7dd5e2fbfd284b95a086347808df392200e slirp4netns-riscv64
23d4a206edd6d3fc9c86f8b05c0881ff77a607b8d471f20964ad9f9c3f3176b1 slirp4netns-s390x
5618887b671a30a2f7548f2bdf7fba98a53981abc80cfd3183cd28b4dc8b2b97 slirp4netns-x86_64

View File

@ -1,3 +0,0 @@
7f25b570f5e954a33df695d41fdf60d060a3096066f1668236fb5e1b4c7b7753 stargz-snapshotter-v0.15.1-linux-amd64.tar.gz
4bd1ac3331501e14d87f5f8c3cde82cb08971d9b55643eb80155f74261e82a5a stargz-snapshotter-v0.15.1-linux-arm64.tar.gz
f1cf855870af16a653d8acb9daa3edf84687c2c05323cb958f078fb148af3eec stargz-snapshotter.service

View File

@ -0,0 +1,3 @@
516984d13e10396f7f6090c51e4e42cc1af9a0d4b16aa81837bcdb1d5a5608d6 stargz-snapshotter-v0.16.3-linux-amd64.tar.gz
d3ac8215603cfd002901c88c568ff5c0685d6953c012fa6ff709deb50f90b023 stargz-snapshotter-v0.16.3-linux-arm64.tar.gz
f1cf855870af16a653d8acb9daa3edf84687c2c05323cb958f078fb148af3eec stargz-snapshotter.service

View File

@ -3,6 +3,7 @@ Description=ipfs daemon for integration test (offline)
[Service]
ExecStart=ipfs daemon --init --offline
Environment=IPFS_PATH="%h/.ipfs"
[Install]
WantedBy=docker-entrypoint.target

View File

@ -16,13 +16,17 @@
set -eux -o pipefail
if [[ "$(id -u)" = "0" ]]; then
# Ensure securityfs is mounted for apparmor to work
if ! mountpoint -q /sys/kernel/security; then
mount -tsecurityfs securityfs /sys/kernel/security
fi
if [ -e /sys/kernel/security/apparmor/profiles ]; then
# Load the "nerdctl-default" profile for TestRunApparmor
nerdctl apparmor load
fi
: "${WORKAROUND_ISSUE_622:=}"
if [[ "$WORKAROUND_ISSUE_622" = "1" ]]; then
if [[ "$WORKAROUND_ISSUE_622" != "" ]]; then
touch /workaround-issue-622
fi

View File

@ -22,6 +22,7 @@
# GitHub ID, Name, Email address, GPG fingerprint
"jsturtevant","James Sturtevant","jstur@microsoft.com",""
"manugupt1", "Manu Gupta", "manugupt1@gmail.com","FCA9 504A 4118 EA5C F466 CC30 A5C3 A8F4 E7FE 9E10"
"Shubhranshu153","Shubharanshu Mahapatra","shubhum@amazon.com",""
# EMERITUS
# See EMERITUS.md

260
Makefile
View File

@ -18,95 +18,252 @@
# Licensed under the Apache License, Version 2.0
# -----------------------------------------------------------------------------
##########################
# Configuration
##########################
PACKAGE := "github.com/containerd/nerdctl/v2"
DOCKER ?= docker
GO ?= go
GOOS ?= $(shell $(GO) env GOOS)
GOARCH ?= $(shell $(GO) env GOARCH)
ifeq ($(GOOS),windows)
BIN_EXT := .exe
endif
PACKAGE := github.com/containerd/nerdctl/v2
# distro builders might wanna override these
# distro builders might want to override these
PREFIX ?= /usr/local
BINDIR ?= $(PREFIX)/bin
DATADIR ?= $(PREFIX)/share
DOCDIR ?= $(DATADIR)/doc
BINARY ?= "nerdctl"
MAKEFILE_DIR := $(patsubst %/,%,$(dir $(abspath $(lastword $(MAKEFILE_LIST)))))
VERSION ?= $(shell git -C $(MAKEFILE_DIR) describe --match 'v[0-9]*' --dirty='.m' --always --tags)
VERSION ?= $(shell git -C $(MAKEFILE_DIR) describe --match 'v[0-9]*' --dirty='.m' --always --tags 2>/dev/null || echo no_git_information)
VERSION_TRIMMED := $(VERSION:v%=%)
REVISION ?= $(shell git -C $(MAKEFILE_DIR) rev-parse HEAD)$(shell if ! git -C $(MAKEFILE_DIR) diff --no-ext-diff --quiet --exit-code; then echo .m; fi)
REVISION ?= $(shell git -C $(MAKEFILE_DIR) rev-parse HEAD 2>/dev/null || echo no_git_information)$(shell if ! git -C $(MAKEFILE_DIR) diff --no-ext-diff --quiet --exit-code 2>/dev/null; then echo .m; fi)
LINT_COMMIT_RANGE ?= main..HEAD
GO_BUILD_LDFLAGS ?= -s -w
GO_BUILD_FLAGS ?=
BUILDTAGS ?=
GO_TAGS=$(if $(BUILDTAGS),-tags "$(strip $(BUILDTAGS))",)
##########################
# Helpers
##########################
ifdef VERBOSE
VERBOSE_FLAG := -v
VERBOSE_FLAG_LONG := --verbose
endif
GO_BUILD_LDFLAGS ?= -s -w
GO_BUILD_FLAGS ?=
export GO_BUILD=CGO_ENABLED=0 GOOS=$(GOOS) $(GO) -C $(MAKEFILE_DIR) build -ldflags "$(GO_BUILD_LDFLAGS) $(VERBOSE_FLAG) -X $(PACKAGE)/pkg/version.Version=$(VERSION) -X $(PACKAGE)/pkg/version.Revision=$(REVISION)"
export GO_BUILD=CGO_ENABLED=0 GOOS=$(GOOS) $(GO) -C $(MAKEFILE_DIR) build $(GO_TAGS) -ldflags "$(GO_BUILD_LDFLAGS) $(VERBOSE_FLAG) -X $(PACKAGE)/pkg/version.Version=$(VERSION) -X $(PACKAGE)/pkg/version.Revision=$(REVISION)"
ifndef NO_COLOR
NC := \033[0m
GREEN := \033[1;32m
ORANGE := \033[1;33m
endif
recursive_wildcard=$(wildcard $1$2) $(foreach e,$(wildcard $1*),$(call recursive_wildcard,$e/,$2))
define title
@printf "$(GREEN)____________________________________________________________________________________________________\n"
@printf "$(GREEN)%*s\n" $$(( ( $(shell echo "🤓$(1) 🤓" | wc -c ) + 100 ) / 2 )) "🤓$(1) 🤓"
@printf "$(GREEN)____________________________________________________________________________________________________\n$(ORANGE)"
endef
define footer
@printf "$(GREEN)> %s: done!\n" "$(1)"
@printf "$(GREEN)____________________________________________________________________________________________________\n$(NC)"
endef
##########################
# High-level tasks definitions
##########################
all: binaries
lint: lint-go-all lint-yaml lint-shell lint-commits lint-mod lint-licenses-all
fix: fix-mod fix-go-all
# TODO: fix race task and add it
test: test-unit # test-unit-race test-unit-bench
help:
@echo "Usage: make <target>"
@echo
@echo " * 'install' - Install binaries to system locations."
@echo " * 'lint' - Run linters against codebase."
@echo " * 'fix' - Automatically fixes imports, modules, and simple formatting."
@echo " * 'test' - Run basic unit testing."
@echo " * 'binaries' - Build nerdctl."
@echo " * 'install' - Install binaries to system locations."
@echo " * 'clean' - Clean artifacts."
@echo " * 'lint' - Run various linters."
nerdctl:
$(GO_BUILD) $(GO_BUILD_FLAGS) $(VERBOSE_FLAG) -o $(CURDIR)/_output/nerdctl$(BIN_EXT) ./cmd/nerdctl
##########################
# Building and installation tasks
##########################
binaries: $(CURDIR)/_output/$(BINARY)$(BIN_EXT)
clean:
find . -name \*~ -delete
find . -name \#\* -delete
rm -rf $(CURDIR)/_output/* $(MAKEFILE_DIR)/vendor
lint: lint-go lint-imports lint-yaml lint-shell
lint-go:
cd $(MAKEFILE_DIR) && GOOS=linux golangci-lint run $(VERBOSE_FLAG_LONG) ./... && \
GOOS=windows golangci-lint run $(VERBOSE_FLAG_LONG) ./... && \
GOOS=freebsd golangci-lint run $(VERBOSE_FLAG_LONG) ./...
lint-imports:
cd $(MAKEFILE_DIR) && ./hack/lint-imports.sh
lint-fix-imports:
cd $(MAKEFILE_DIR) && goimports-reviser -company-prefixes "github.com/containerd" ./...
lint-yaml:
cd $(MAKEFILE_DIR) && yamllint .
lint-shell: $(call recursive_wildcard,$(MAKEFILE_DIR)/,*.sh)
shellcheck -a -x $^
test-unit:
go test -v $(MAKEFILE_DIR)/pkg/...
binaries: nerdctl
$(CURDIR)/_output/$(BINARY)$(BIN_EXT):
$(call title, $@: $(GOOS)/$(GOARCH))
$(GO_BUILD) $(GO_BUILD_FLAGS) $(VERBOSE_FLAG) -o $(CURDIR)/_output/$(BINARY)$(BIN_EXT) ./cmd/nerdctl
$(call footer, $@)
install:
install -D -m 755 $(CURDIR)/_output/nerdctl $(DESTDIR)$(BINDIR)/nerdctl
$(call title, $@)
install -D -m 755 $(CURDIR)/_output/$(BINARY) $(DESTDIR)$(BINDIR)/$(BINARY)
install -D -m 755 $(MAKEFILE_DIR)/extras/rootless/containerd-rootless.sh $(DESTDIR)$(BINDIR)/containerd-rootless.sh
install -D -m 755 $(MAKEFILE_DIR)/extras/rootless/containerd-rootless-setuptool.sh $(DESTDIR)$(BINDIR)/containerd-rootless-setuptool.sh
install -D -m 644 -t $(DESTDIR)$(DOCDIR)/nerdctl $(MAKEFILE_DIR)/docs/*.md
$(call footer, $@)
clean:
$(call title, $@)
find . -name \*~ -delete
find . -name \#\* -delete
rm -rf $(CURDIR)/_output/* $(MAKEFILE_DIR)/vendor
$(call footer, $@)
##########################
# Linting tasks
##########################
lint-go:
$(call title, $@: $(GOOS))
@cd $(MAKEFILE_DIR) \
&& golangci-lint run $(VERBOSE_FLAG_LONG) ./...
$(call footer, $@)
lint-go-all:
$(call title, $@)
@cd $(MAKEFILE_DIR) \
&& GOOS=linux make lint-go \
&& GOOS=windows make lint-go \
&& GOOS=freebsd make lint-go \
&& GOOS=darwin make lint-go
$(call footer, $@)
lint-yaml:
$(call title, $@)
cd $(MAKEFILE_DIR) \
&& yamllint .
$(call footer, $@)
lint-shell: $(call recursive_wildcard,$(MAKEFILE_DIR)/,*.sh)
$(call title, $@)
shellcheck -a -x $^
$(call footer, $@)
lint-commits:
$(call title, $@)
@cd $(MAKEFILE_DIR) \
&& git-validation $(VERBOSE_FLAG) -run DCO,short-subject,dangling-whitespace -range "$(LINT_COMMIT_RANGE)"
$(call footer, $@)
lint-mod:
$(call title, $@)
@cd $(MAKEFILE_DIR) \
&& go mod tidy --diff
$(call footer, $@)
# FIXME: go-licenses cannot find LICENSE from root of repo when submodule is imported:
# https://github.com/google/go-licenses/issues/186
# This is impacting gotest.tools
# FIXME: go-base36 is multi-license (MIT/Apache), using a custom boilerplate file that go-licenses fails to understand
lint-licenses:
$(call title, $@: $(GOOS))
@cd $(MAKEFILE_DIR) \
&& go-licenses check --include_tests --allowed_licenses=Apache-2.0,BSD-2-Clause,BSD-2-Clause-FreeBSD,BSD-3-Clause,MIT,ISC,Python-2.0,PostgreSQL,X11,Zlib \
--ignore gotest.tools \
--ignore github.com/multiformats/go-base36 \
./...
$(call footer, $@)
lint-licenses-all:
$(call title, $@)
@cd $(MAKEFILE_DIR) \
&& GOOS=linux make lint-licenses \
&& GOOS=windows make lint-licenses \
&& GOOS=freebsd make lint-licenses \
&& GOOS=darwin make lint-licenses
$(call footer, $@)
##########################
# Automated fixing tasks
##########################
fix-go:
$(call title, $@: $(GOOS))
@cd $(MAKEFILE_DIR) \
&& golangci-lint run --fix
$(call footer, $@)
fix-go-all:
$(call title, $@)
@cd $(MAKEFILE_DIR) \
&& GOOS=linux make fix-go \
&& GOOS=windows make fix-go \
&& GOOS=freebsd make fix-go \
&& GOOS=darwin make fix-go
$(call footer, $@)
fix-mod:
$(call title, $@)
@cd $(MAKEFILE_DIR) \
&& go mod tidy
$(call footer, $@)
##########################
# Development tools installation
##########################
install-dev-tools:
$(call title, $@)
# golangci: v2.0.2 (2024-03-26)
# git-validation: main (2025-02-25)
# ltag: main (2025-03-04)
# go-licenses: v2.0.0-alpha.1 (2024-06-27)
# stubbing go-licenses with dependency upgrade due to non-compatibility with golang 1.25rc1
# Issue: https://github.com/google/go-licenses/issues/312
@cd $(MAKEFILE_DIR) \
&& go install github.com/Shubhranshu153/go-licenses/v2@f8c503d1357dffb6c97ed3b94e912ab294dde24a \
&& go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@2b224c2cf4c9f261c22a16af7f8ca6408467f338 \
&& go install github.com/vbatts/git-validation@7b60e35b055dd2eab5844202ffffad51d9c93922 \
&& go install github.com/containerd/ltag@66e6a514664ee2d11a470735519fa22b1a9eaabd \
&& go install gotest.tools/gotestsum@0d9599e513d70e5792bb9334869f82f6e8b53d4d
@echo "Remember to add \$$HOME/go/bin to your path"
$(call footer, $@)
##########################
# Testing tasks
##########################
test-unit:
$(call title, $@)
@go test $(VERBOSE_FLAG) $(MAKEFILE_DIR)/pkg/...
$(call footer, $@)
test-unit-bench:
$(call title, $@)
@go test $(VERBOSE_FLAG) $(MAKEFILE_DIR)/pkg/... -bench=.
$(call footer, $@)
test-unit-race:
$(call title, $@)
@go test $(VERBOSE_FLAG) $(MAKEFILE_DIR)/pkg/... -race
$(call footer, $@)
##########################
# Release tasks
##########################
# Note that these options will not work on macOS - unless you use gnu-tar instead of tar
TAR_OWNER0_FLAGS=--owner=0 --group=0
TAR_FLATTEN_FLAGS=--transform 's/.*\///g'
define make_artifact_full_linux
$(DOCKER) build --output type=tar,dest=$(CURDIR)/_output/nerdctl-full-$(VERSION_TRIMMED)-linux-$(1).tar --target out-full --platform $(1) --build-arg GO_VERSION -f $(MAKEFILE_DIR)/Dockerfile $(MAKEFILE_DIR)
$(DOCKER) build --secret id=github_token,env=GITHUB_TOKEN --output type=tar,dest=$(CURDIR)/_output/nerdctl-full-$(VERSION_TRIMMED)-linux-$(1).tar --target out-full --platform $(1) --build-arg GO_VERSION -f $(MAKEFILE_DIR)/Dockerfile $(MAKEFILE_DIR)
gzip -9 $(CURDIR)/_output/nerdctl-full-$(VERSION_TRIMMED)-linux-$(1).tar
endef
artifacts: clean
$(call title, $@)
GOOS=linux GOARCH=amd64 make -C $(CURDIR) -f $(MAKEFILE_DIR)/Makefile binaries
tar $(TAR_OWNER0_FLAGS) $(TAR_FLATTEN_FLAGS) -czvf $(CURDIR)/_output/nerdctl-$(VERSION_TRIMMED)-linux-amd64.tar.gz $(CURDIR)/_output/nerdctl $(MAKEFILE_DIR)/extras/rootless/*
@ -116,6 +273,9 @@ artifacts: clean
GOOS=linux GOARCH=arm GOARM=7 make -C $(CURDIR) -f $(MAKEFILE_DIR)/Makefile binaries
tar $(TAR_OWNER0_FLAGS) $(TAR_FLATTEN_FLAGS) -czvf $(CURDIR)/_output/nerdctl-$(VERSION_TRIMMED)-linux-arm-v7.tar.gz $(CURDIR)/_output/nerdctl $(MAKEFILE_DIR)/extras/rootless/*
GOOS=linux GOARCH=loong64 make -C $(CURDIR) -f $(MAKEFILE_DIR)/Makefile binaries
tar $(TAR_OWNER0_FLAGS) $(TAR_FLATTEN_FLAGS) -czvf $(CURDIR)/_output/nerdctl-$(VERSION_TRIMMED)-linux-loong64.tar.gz $(CURDIR)/_output/nerdctl $(MAKEFILE_DIR)/extras/rootless/*
GOOS=linux GOARCH=ppc64le make -C $(CURDIR) -f $(MAKEFILE_DIR)/Makefile binaries
tar $(TAR_OWNER0_FLAGS) $(TAR_FLATTEN_FLAGS) -czvf $(CURDIR)/_output/nerdctl-$(VERSION_TRIMMED)-linux-ppc64le.tar.gz $(CURDIR)/_output/nerdctl $(MAKEFILE_DIR)/extras/rootless/*
@ -138,15 +298,19 @@ artifacts: clean
$(GO) -C $(MAKEFILE_DIR) mod vendor
tar $(TAR_OWNER0_FLAGS) -czf $(CURDIR)/_output/nerdctl-$(VERSION_TRIMMED)-go-mod-vendor.tar.gz $(MAKEFILE_DIR)/go.mod $(MAKEFILE_DIR)/go.sum $(MAKEFILE_DIR)/vendor
$(call footer, $@)
.PHONY: \
all \
lint \
fix \
test \
help \
nerdctl \
clean \
binaries \
install \
clean \
lint-go lint-go-all lint-yaml lint-shell lint-commits lint-mod lint-licenses lint-licenses-all \
fix-go fix-go-all fix-mod \
install-dev-tools \
test-unit test-unit-race test-unit-bench \
artifacts
lint \
lint-yaml \
lint-go \
lint-shell

View File

@ -36,6 +36,10 @@ Vagrant.configure("2") do |config|
sh.inline = <<~SHELL
#!/usr/bin/env bash
set -eux -o pipefail
freebsd-version -kru
# switching to "release_2" ensures compatibility with the current Vagrant box
# https://github.com/moby/buildkit/pull/5893
sed -i '' 's/latest/release_2/' /usr/local/etc/pkg/repos/FreeBSD.conf
# `pkg install go` still installs Go 1.20 (March 2024)
pkg install -y go122 containerd runj
ln -s go122 /usr/local/bin/go
@ -59,7 +63,7 @@ Vagrant.configure("2") do |config|
set -eux -o pipefail
daemon -o containerd.out containerd
sleep 3
/root/go/bin/nerdctl run --rm --net=none dougrabson/freebsd-minimal:13 echo "Nerdctl is up and running."
CONTAINERD_ADDRESS=/run/containerd/containerd.sock /root/go/bin/nerdctl run --rm --quiet --net=none dougrabson/freebsd-minimal:13 echo "Nerdctl is up and running."
SHELL
end

View File

@ -26,19 +26,19 @@ import (
"github.com/containerd/nerdctl/v2/pkg/defaults"
)
func newApparmorInspectCommand() *cobra.Command {
func inspectCommand() *cobra.Command {
cmd := &cobra.Command{
Use: "inspect",
Short: fmt.Sprintf("Display the default AppArmor profile %q. Other profiles cannot be displayed with this command.", defaults.AppArmorProfileName),
Args: cobra.NoArgs,
RunE: apparmorInspectAction,
RunE: inspectAction,
SilenceUsage: true,
SilenceErrors: true,
}
return cmd
}
func apparmorInspectAction(cmd *cobra.Command, args []string) error {
func inspectAction(cmd *cobra.Command, args []string) error {
return apparmor.Inspect(types.ApparmorInspectOptions{
Stdout: cmd.OutOrStdout(),
})

View File

@ -22,7 +22,7 @@ import (
"github.com/containerd/nerdctl/v2/cmd/nerdctl/helpers"
)
func NewApparmorCommand() *cobra.Command {
func Command() *cobra.Command {
cmd := &cobra.Command{
Annotations: map[string]string{helpers.Category: helpers.Management},
Use: "apparmor",
@ -32,10 +32,10 @@ func NewApparmorCommand() *cobra.Command {
SilenceErrors: true,
}
cmd.AddCommand(
newApparmorLsCommand(),
newApparmorInspectCommand(),
newApparmorLoadCommand(),
newApparmorUnloadCommand(),
listCommand(),
inspectCommand(),
loadCommand(),
unloadCommand(),
)
return cmd
}

View File

@ -23,13 +23,13 @@ import (
"github.com/containerd/nerdctl/v2/pkg/cmd/apparmor"
)
func newApparmorLsCommand() *cobra.Command {
func listCommand() *cobra.Command {
cmd := &cobra.Command{
Use: "ls",
Aliases: []string{"list"},
Short: "List the loaded AppArmor profiles",
Args: cobra.NoArgs,
RunE: apparmorLsAction,
RunE: listAction,
SilenceUsage: true,
SilenceErrors: true,
}
@ -42,7 +42,7 @@ func newApparmorLsCommand() *cobra.Command {
return cmd
}
func processApparmorListOptions(cmd *cobra.Command) (types.ApparmorListOptions, error) {
func listOptions(cmd *cobra.Command) (types.ApparmorListOptions, error) {
quiet, err := cmd.Flags().GetBool("quiet")
if err != nil {
return types.ApparmorListOptions{}, err
@ -58,8 +58,8 @@ func processApparmorListOptions(cmd *cobra.Command) (types.ApparmorListOptions,
}, nil
}
func apparmorLsAction(cmd *cobra.Command, args []string) error {
options, err := processApparmorListOptions(cmd)
func listAction(cmd *cobra.Command, args []string) error {
options, err := listOptions(cmd)
if err != nil {
return err
}

View File

@ -25,18 +25,18 @@ import (
"github.com/containerd/nerdctl/v2/pkg/defaults"
)
func newApparmorLoadCommand() *cobra.Command {
func loadCommand() *cobra.Command {
cmd := &cobra.Command{
Use: "load",
Short: fmt.Sprintf("Load the default AppArmor profile %q. Requires root.", defaults.AppArmorProfileName),
Args: cobra.NoArgs,
RunE: apparmorLoadAction,
RunE: loadAction,
SilenceUsage: true,
SilenceErrors: true,
}
return cmd
}
func apparmorLoadAction(cmd *cobra.Command, args []string) error {
func loadAction(cmd *cobra.Command, args []string) error {
return apparmor.Load()
}

View File

@ -26,20 +26,20 @@ import (
"github.com/containerd/nerdctl/v2/pkg/defaults"
)
func newApparmorUnloadCommand() *cobra.Command {
func unloadCommand() *cobra.Command {
cmd := &cobra.Command{
Use: "unload [PROFILE]",
Short: fmt.Sprintf("Unload an AppArmor profile. The target profile name defaults to %q. Requires root.", defaults.AppArmorProfileName),
Args: cobra.MaximumNArgs(1),
RunE: apparmorUnloadAction,
ValidArgsFunction: apparmorUnloadShellComplete,
RunE: unloadAction,
ValidArgsFunction: unloadShellComplete,
SilenceUsage: true,
SilenceErrors: true,
}
return cmd
}
func apparmorUnloadAction(cmd *cobra.Command, args []string) error {
func unloadAction(cmd *cobra.Command, args []string) error {
target := defaults.AppArmorProfileName
if len(args) > 0 {
target = args[0]
@ -47,6 +47,6 @@ func apparmorUnloadAction(cmd *cobra.Command, args []string) error {
return apparmor.Unload(target)
}
func apparmorUnloadShellComplete(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) {
func unloadShellComplete(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) {
return completion.ApparmorProfiles(cmd)
}

View File

@ -21,6 +21,7 @@ import (
"os"
"os/exec"
"strings"
"time"
"github.com/docker/go-units"
"github.com/spf13/cobra"
@ -30,8 +31,8 @@ import (
"github.com/containerd/nerdctl/v2/pkg/cmd/builder"
)
func NewBuilderCommand() *cobra.Command {
var builderCommand = &cobra.Command{
func Command() *cobra.Command {
var cmd = &cobra.Command{
Annotations: map[string]string{helpers.Category: helpers.Management},
Use: "builder",
Short: "Manage builds",
@ -39,34 +40,33 @@ func NewBuilderCommand() *cobra.Command {
SilenceUsage: true,
SilenceErrors: true,
}
builderCommand.AddCommand(
NewBuildCommand(),
newBuilderPruneCommand(),
newBuilderDebugCommand(),
cmd.AddCommand(
BuildCommand(),
pruneCommand(),
debugCommand(),
)
return builderCommand
return cmd
}
func newBuilderPruneCommand() *cobra.Command {
func pruneCommand() *cobra.Command {
shortHelp := `Clean up BuildKit build cache`
var buildPruneCommand = &cobra.Command{
var cmd = &cobra.Command{
Use: "prune",
Args: cobra.NoArgs,
Short: shortHelp,
RunE: builderPruneAction,
RunE: pruneAction,
SilenceUsage: true,
SilenceErrors: true,
}
helpers.AddStringFlag(buildPruneCommand, "buildkit-host", nil, "", "BUILDKIT_HOST", "BuildKit address")
buildPruneCommand.Flags().BoolP("all", "a", false, "Remove all unused build cache, not just dangling ones")
buildPruneCommand.Flags().BoolP("force", "f", false, "Do not prompt for confirmation")
return buildPruneCommand
cmd.Flags().String("buildkit-host", "", "BuildKit address")
cmd.Flags().BoolP("all", "a", false, "Remove all unused build cache, not just dangling ones")
cmd.Flags().BoolP("force", "f", false, "Do not prompt for confirmation")
return cmd
}
func builderPruneAction(cmd *cobra.Command, _ []string) error {
options, err := processBuilderPruneOptions(cmd)
func pruneAction(cmd *cobra.Command, _ []string) error {
options, err := pruneOptions(cmd)
if err != nil {
return err
}
@ -101,7 +101,7 @@ func builderPruneAction(cmd *cobra.Command, _ []string) error {
return nil
}
func processBuilderPruneOptions(cmd *cobra.Command) (types.BuilderPruneOptions, error) {
func pruneOptions(cmd *cobra.Command) (types.BuilderPruneOptions, error) {
globalOptions, err := helpers.ProcessRootCmdFlags(cmd)
if err != nil {
return types.BuilderPruneOptions{}, err
@ -131,26 +131,27 @@ func processBuilderPruneOptions(cmd *cobra.Command) (types.BuilderPruneOptions,
}, nil
}
func newBuilderDebugCommand() *cobra.Command {
func debugCommand() *cobra.Command {
shortHelp := `Debug Dockerfile`
var buildDebugCommand = &cobra.Command{
var cmd = &cobra.Command{
Use: "debug",
Short: shortHelp,
PreRunE: helpers.CheckExperimental("`nerdctl builder debug`"),
RunE: builderDebugAction,
RunE: debugAction,
SilenceUsage: true,
SilenceErrors: true,
}
buildDebugCommand.Flags().StringP("file", "f", "", "Name of the Dockerfile")
buildDebugCommand.Flags().String("target", "", "Set the target build stage to build")
buildDebugCommand.Flags().StringArray("build-arg", nil, "Set build-time variables")
buildDebugCommand.Flags().String("image", "", "Image to use for debugging stage")
buildDebugCommand.Flags().StringArray("ssh", nil, "Allow forwarding SSH agent to the build. Format: default|<id>[=<socket>|<key>[,<key>]]")
buildDebugCommand.Flags().StringArray("secret", nil, "Expose secret value to the build. Format: id=secretname,src=filepath")
return buildDebugCommand
cmd.Flags().StringP("file", "f", "", "Name of the Dockerfile")
cmd.Flags().String("target", "", "Set the target build stage to build")
cmd.Flags().StringArray("build-arg", nil, "Set build-time variables")
cmd.Flags().String("image", "", "Image to use for debugging stage")
cmd.Flags().StringArray("ssh", nil, "Allow forwarding SSH agent to the build. Format: default|<id>[=<socket>|<key>[,<key>]]")
cmd.Flags().StringArray("secret", nil, "Expose secret value to the build. Format: id=secretname,src=filepath")
helpers.AddDurationFlag(cmd, "buildg-startup-timeout", nil, 1*time.Minute, "", "Timeout for starting up buildg")
return cmd
}
func builderDebugAction(cmd *cobra.Command, args []string) error {
func debugAction(cmd *cobra.Command, args []string) error {
globalOptions, err := helpers.ProcessRootCmdFlags(cmd)
if err != nil {
return err
@ -168,6 +169,12 @@ func builderDebugAction(cmd *cobra.Command, args []string) error {
buildgArgs = append([]string{"--debug"}, buildgArgs...)
}
startupTimeout, err := cmd.Flags().GetDuration("buildg-startup-timeout")
if err != nil {
return err
}
buildgArgs = append(buildgArgs, "--startup-timeout="+startupTimeout.String())
if file, err := cmd.Flags().GetString("file"); err != nil {
return err
} else if file != "" {

View File

@ -19,12 +19,13 @@ package builder
import (
"errors"
"fmt"
"os"
"strconv"
"strings"
"github.com/spf13/cobra"
"github.com/containerd/log"
"github.com/containerd/nerdctl/v2/cmd/nerdctl/completion"
"github.com/containerd/nerdctl/v2/cmd/nerdctl/helpers"
"github.com/containerd/nerdctl/v2/pkg/api/types"
@ -34,8 +35,8 @@ import (
"github.com/containerd/nerdctl/v2/pkg/strutil"
)
func NewBuildCommand() *cobra.Command {
var buildCommand = &cobra.Command{
func BuildCommand() *cobra.Command {
var cmd = &cobra.Command{
Use: "build [flags] PATH",
Short: "Build an image from a Dockerfile. Needs buildkitd to be running.",
Long: `Build an image from a Dockerfile. Needs buildkitd to be running.
@ -44,43 +45,44 @@ If Dockerfile is not present and -f is not specified, it will look for Container
SilenceUsage: true,
SilenceErrors: true,
}
helpers.AddStringFlag(buildCommand, "buildkit-host", nil, "", "BUILDKIT_HOST", "BuildKit address")
buildCommand.Flags().StringArrayP("tag", "t", nil, "Name and optionally a tag in the 'name:tag' format")
buildCommand.Flags().StringP("file", "f", "", "Name of the Dockerfile")
buildCommand.Flags().String("target", "", "Set the target build stage to build")
buildCommand.Flags().StringArray("build-arg", nil, "Set build-time variables")
buildCommand.Flags().Bool("no-cache", false, "Do not use cache when building the image")
buildCommand.Flags().StringP("output", "o", "", "Output destination (format: type=local,dest=path)")
buildCommand.Flags().String("progress", "auto", "Set type of progress output (auto, plain, tty). Use plain to show container output")
buildCommand.Flags().String("provenance", "", "Shorthand for \"--attest=type=provenance\"")
buildCommand.Flags().Bool("pull", false, "On true, always attempt to pull latest image version from remote. Default uses buildkit's default.")
buildCommand.Flags().StringArray("secret", nil, "Secret file to expose to the build: id=mysecret,src=/local/secret")
buildCommand.Flags().StringArray("allow", nil, "Allow extra privileged entitlement, e.g. network.host, security.insecure")
buildCommand.RegisterFlagCompletionFunc("allow", func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) {
cmd.Flags().String("buildkit-host", "", "BuildKit address")
cmd.Flags().StringArray("add-host", nil, "Add a custom host-to-IP mapping (format: \"host:ip\")")
cmd.Flags().StringArrayP("tag", "t", nil, "Name and optionally a tag in the 'name:tag' format")
cmd.Flags().StringP("file", "f", "", "Name of the Dockerfile")
cmd.Flags().String("target", "", "Set the target build stage to build")
cmd.Flags().StringArray("build-arg", nil, "Set build-time variables")
cmd.Flags().Bool("no-cache", false, "Do not use cache when building the image")
cmd.Flags().StringP("output", "o", "", "Output destination (format: type=local,dest=path)")
cmd.Flags().String("progress", "auto", "Set type of progress output (auto, plain, tty). Use plain to show container output")
cmd.Flags().String("provenance", "", "Shorthand for \"--attest=type=provenance\"")
cmd.Flags().Bool("pull", false, "On true, always attempt to pull latest image version from remote. Default uses buildkit's default.")
cmd.Flags().StringArray("secret", nil, "Secret file to expose to the build: id=mysecret,src=/local/secret")
cmd.Flags().StringArray("allow", nil, "Allow extra privileged entitlement, e.g. network.host, security.insecure")
cmd.RegisterFlagCompletionFunc("allow", func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) {
return []string{"network.host", "security.insecure"}, cobra.ShellCompDirectiveNoFileComp
})
buildCommand.Flags().StringArray("attest", nil, "Attestation parameters (format: \"type=sbom,generator=image\")")
buildCommand.Flags().StringArray("ssh", nil, "SSH agent socket or keys to expose to the build (format: default|<id>[=<socket>|<key>[,<key>]])")
buildCommand.Flags().BoolP("quiet", "q", false, "Suppress the build output and print image ID on success")
buildCommand.Flags().String("sbom", "", "Shorthand for \"--attest=type=sbom\"")
buildCommand.Flags().StringArray("cache-from", nil, "External cache sources (eg. user/app:cache, type=local,src=path/to/dir)")
buildCommand.Flags().StringArray("cache-to", nil, "Cache export destinations (eg. user/app:cache, type=local,dest=path/to/dir)")
buildCommand.Flags().Bool("rm", true, "Remove intermediate containers after a successful build")
buildCommand.Flags().String("network", "default", "Set type of network for build (format:network=default|none|host)")
buildCommand.RegisterFlagCompletionFunc("network", func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) {
cmd.Flags().StringArray("attest", nil, "Attestation parameters (format: \"type=sbom,generator=image\")")
cmd.Flags().StringArray("ssh", nil, "SSH agent socket or keys to expose to the build (format: default|<id>[=<socket>|<key>[,<key>]])")
cmd.Flags().BoolP("quiet", "q", false, "Suppress the build output and print image ID on success")
cmd.Flags().String("sbom", "", "Shorthand for \"--attest=type=sbom\"")
cmd.Flags().StringArray("cache-from", nil, "External cache sources (eg. user/app:cache, type=local,src=path/to/dir)")
cmd.Flags().StringArray("cache-to", nil, "Cache export destinations (eg. user/app:cache, type=local,dest=path/to/dir)")
cmd.Flags().Bool("rm", true, "Remove intermediate containers after a successful build")
cmd.Flags().String("network", "default", "Set type of network for build (format:network=default|none|host)")
cmd.RegisterFlagCompletionFunc("network", func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) {
return []string{"default", "host", "none"}, cobra.ShellCompDirectiveNoFileComp
})
// #region platform flags
// platform is defined as StringSlice, not StringArray, to allow specifying "--platform=amd64,arm64"
buildCommand.Flags().StringSlice("platform", []string{}, "Set target platform for build (e.g., \"amd64\", \"arm64\")")
buildCommand.RegisterFlagCompletionFunc("platform", completion.Platforms)
buildCommand.Flags().StringArray("build-context", []string{}, "Additional build contexts (e.g., name=path)")
cmd.Flags().StringSlice("platform", []string{}, "Set target platform for build (e.g., \"amd64\", \"arm64\")")
cmd.RegisterFlagCompletionFunc("platform", completion.Platforms)
cmd.Flags().StringArray("build-context", []string{}, "Additional build contexts (e.g., name=path)")
// #endregion
buildCommand.Flags().String("iidfile", "", "Write the image ID to the file")
buildCommand.Flags().StringArray("label", nil, "Set metadata for an image")
cmd.Flags().String("iidfile", "", "Write the image ID to the file")
cmd.Flags().StringArray("label", nil, "Set metadata for an image")
return buildCommand
return cmd
}
func processBuildCommandFlag(cmd *cobra.Command, args []string) (types.BuilderBuildOptions, error) {
@ -92,6 +94,10 @@ func processBuildCommandFlag(cmd *cobra.Command, args []string) (types.BuilderBu
if err != nil {
return types.BuilderBuildOptions{}, err
}
extraHosts, err := cmd.Flags().GetStringArray("add-host")
if err != nil {
return types.BuilderBuildOptions{}, err
}
platform, err := cmd.Flags().GetStringSlice("platform")
if err != nil {
return types.BuilderBuildOptions{}, err
@ -204,6 +210,13 @@ func processBuildCommandFlag(cmd *cobra.Command, args []string) (types.BuilderBu
return types.BuilderBuildOptions{}, err
}
usernsRemap, err := cmd.Flags().GetString("userns-remap")
if err != nil {
return types.BuilderBuildOptions{}, err
} else if usernsRemap != "" {
log.L.Warn("userns remap is not supported with nerdctl build. dropping the config.")
}
return types.BuilderBuildOptions{
GOptions: globalOptions,
BuildKitHost: buildKitHost,
@ -232,11 +245,12 @@ func processBuildCommandFlag(cmd *cobra.Command, args []string) (types.BuilderBu
Stdin: cmd.InOrStdin(),
NetworkMode: network,
ExtendedBuildContext: extendedBuildCtx,
ExtraHosts: extraHosts,
}, nil
}
func GetBuildkitHost(cmd *cobra.Command, namespace string) (string, error) {
if cmd.Flags().Changed("buildkit-host") || os.Getenv("BUILDKIT_HOST") != "" {
if cmd.Flags().Changed("buildkit-host") {
// If address is explicitly specified, use it.
buildkitHost, err := cmd.Flags().GetString("buildkit-host")
if err != nil {
@ -247,6 +261,7 @@ func GetBuildkitHost(cmd *cobra.Command, namespace string) (string, error) {
}
return buildkitHost, nil
}
return buildkitutil.GetBuildkitHost(namespace)
}

View File

@ -18,16 +18,19 @@ package builder
import (
"fmt"
"os"
"path/filepath"
"strings"
"testing"
"gotest.tools/v3/assert"
"github.com/containerd/nerdctl/mod/tigron/expect"
"github.com/containerd/nerdctl/mod/tigron/require"
"github.com/containerd/nerdctl/mod/tigron/test"
"github.com/containerd/nerdctl/mod/tigron/tig"
"github.com/containerd/nerdctl/v2/pkg/testutil"
"github.com/containerd/nerdctl/v2/pkg/testutil/nerdtest"
"github.com/containerd/nerdctl/v2/pkg/testutil/test"
)
func TestBuildContextWithOCILayout(t *testing.T) {
@ -36,23 +39,23 @@ func TestBuildContextWithOCILayout(t *testing.T) {
var dockerBuilderArgs []string
testCase := &test.Case{
Require: test.Require(
Require: require.All(
nerdtest.Build,
test.Not(test.Windows),
require.Not(require.Windows),
),
Cleanup: func(data test.Data, helpers test.Helpers) {
if nerdtest.IsDocker() {
helpers.Anyhow("buildx", "stop", data.Identifier("-container"))
helpers.Anyhow("buildx", "rm", "--force", data.Identifier("-container"))
helpers.Anyhow("buildx", "stop", data.Identifier("container"))
helpers.Anyhow("buildx", "rm", "--force", data.Identifier("container"))
}
helpers.Anyhow("rmi", "-f", data.Identifier("-parent"))
helpers.Anyhow("rmi", "-f", data.Identifier("-child"))
helpers.Anyhow("rmi", "-f", data.Identifier("parent"))
helpers.Anyhow("rmi", "-f", data.Identifier("child"))
},
Setup: func(data test.Data, helpers test.Helpers) {
// Default docker driver does not support OCI exporter.
// Reference: https://docs.docker.com/build/exporters/oci-docker/
if nerdtest.IsDocker() {
name := data.Identifier("-container")
name := data.Identifier("container")
helpers.Ensure("buildx", "create", "--name", name, "--driver=docker-container")
dockerBuilderArgs = []string{"buildx", "--builder", name}
}
@ -61,25 +64,21 @@ func TestBuildContextWithOCILayout(t *testing.T) {
LABEL layer=oci-layout-parent
CMD ["echo", "test-nerdctl-build-context-oci-layout-parent"]`, testutil.CommonImage)
buildCtx := data.TempDir()
err := os.WriteFile(filepath.Join(buildCtx, "Dockerfile"), []byte(dockerfile), 0o600)
assert.NilError(helpers.T(), err)
data.Temp().Save(dockerfile, "Dockerfile")
dest := data.Temp().Dir("parent")
tarPath := data.Temp().Path("parent.tar")
tarPath := filepath.Join(buildCtx, "parent.tar")
dest := filepath.Join(buildCtx, "parent")
assert.NilError(helpers.T(), os.MkdirAll(dest, 0o700))
helpers.Ensure("build", buildCtx, "--tag", data.Identifier("-parent"))
helpers.Ensure("image", "save", "--output", tarPath, data.Identifier("-parent"))
helpers.Custom("tar", "Cxf", dest, tarPath).Run(&test.Expected{})
helpers.Ensure("build", data.Temp().Path(), "--tag", data.Identifier("parent"))
helpers.Ensure("image", "save", "--output", tarPath, data.Identifier("parent"))
helpers.Custom("tar", "Cxf", dest, tarPath).Run(&test.Expected{
ExitCode: expect.ExitCodeSuccess,
})
},
Command: func(data test.Data, helpers test.Helpers) test.TestableCommand {
dockerfile := `FROM parent
CMD ["echo", "test-nerdctl-build-context-oci-layout"]`
buildCtx := data.TempDir()
err := os.WriteFile(filepath.Join(buildCtx, "Dockerfile"), []byte(dockerfile), 0o600)
assert.NilError(helpers.T(), err)
data.Temp().Save(dockerfile, "Dockerfile")
var cmd test.TestableCommand
if nerdtest.IsDocker() {
@ -87,7 +86,13 @@ CMD ["echo", "test-nerdctl-build-context-oci-layout"]`
} else {
cmd = helpers.Command()
}
cmd.WithArgs("build", buildCtx, fmt.Sprintf("--build-context=parent=oci-layout://%s", filepath.Join(buildCtx, "parent")), "--tag", data.Identifier("-child"))
cmd.WithArgs(
"build",
data.Temp().Path(),
fmt.Sprintf("--build-context=parent=oci-layout://%s", filepath.Join(data.Temp().Path(), "parent")),
"--tag",
data.Identifier("child"),
)
if nerdtest.IsDocker() {
// Need to load the container image from the builder to be able to run it.
cmd.WithArgs("--load")
@ -96,8 +101,14 @@ CMD ["echo", "test-nerdctl-build-context-oci-layout"]`
},
Expected: func(data test.Data, helpers test.Helpers) *test.Expected {
return &test.Expected{
Output: func(stdout string, info string, t *testing.T) {
assert.Assert(t, strings.Contains(helpers.Capture("run", "--rm", data.Identifier("-child")), "test-nerdctl-build-context-oci-layout"), info)
Output: func(stdout string, t tig.T) {
assert.Assert(
t,
strings.Contains(
helpers.Capture("run", "--rm", data.Identifier("child")),
"test-nerdctl-build-context-oci-layout",
),
)
},
}
},

File diff suppressed because it is too large Load Diff

View File

@ -17,18 +17,22 @@
package builder
import (
"bytes"
"errors"
"fmt"
"os"
"path/filepath"
"strings"
"testing"
"gotest.tools/v3/assert"
"github.com/containerd/nerdctl/mod/tigron/expect"
"github.com/containerd/nerdctl/mod/tigron/require"
"github.com/containerd/nerdctl/mod/tigron/test"
"github.com/containerd/nerdctl/v2/pkg/buildkitutil"
"github.com/containerd/nerdctl/v2/pkg/referenceutil"
"github.com/containerd/nerdctl/v2/pkg/testutil"
"github.com/containerd/nerdctl/v2/pkg/testutil/nerdtest"
"github.com/containerd/nerdctl/v2/pkg/testutil/test"
)
func TestBuilder(t *testing.T) {
@ -36,9 +40,9 @@ func TestBuilder(t *testing.T) {
testCase := &test.Case{
NoParallel: true,
Require: test.Require(
Require: require.All(
nerdtest.Build,
test.Not(test.Windows),
require.Not(require.Windows),
),
SubTests: []*test.Case{
{
@ -47,10 +51,8 @@ func TestBuilder(t *testing.T) {
Setup: func(data test.Data, helpers test.Helpers) {
dockerfile := fmt.Sprintf(`FROM %s
CMD ["echo", "nerdctl-test-builder-prune"]`, testutil.CommonImage)
buildCtx := data.TempDir()
err := os.WriteFile(filepath.Join(buildCtx, "Dockerfile"), []byte(dockerfile), 0o600)
assert.NilError(helpers.T(), err)
helpers.Ensure("build", buildCtx)
data.Temp().Save(dockerfile, "Dockerfile")
helpers.Ensure("build", data.Temp().Path())
},
Command: test.Command("builder", "prune", "--force"),
Expected: test.Expects(0, nil, nil),
@ -61,61 +63,127 @@ CMD ["echo", "nerdctl-test-builder-prune"]`, testutil.CommonImage)
Setup: func(data test.Data, helpers test.Helpers) {
dockerfile := fmt.Sprintf(`FROM %s
CMD ["echo", "nerdctl-test-builder-prune"]`, testutil.CommonImage)
buildCtx := data.TempDir()
err := os.WriteFile(filepath.Join(buildCtx, "Dockerfile"), []byte(dockerfile), 0o600)
assert.NilError(helpers.T(), err)
helpers.Ensure("build", buildCtx)
data.Temp().Save(dockerfile, "Dockerfile")
helpers.Ensure("build", data.Temp().Path())
},
Command: test.Command("builder", "prune", "--force", "--all"),
Expected: test.Expects(0, nil, nil),
},
{
Description: "Debug",
Description: "builder with buildkit-host",
NoParallel: true,
Require: require.Not(nerdtest.Docker),
Setup: func(data test.Data, helpers test.Helpers) {
// Get BuildkitAddr
buildkitAddr, err := buildkitutil.GetBuildkitHost(testutil.Namespace)
assert.NilError(helpers.T(), err)
buildkitAddr = strings.TrimPrefix(buildkitAddr, "unix://")
// Symlink the buildkit Socket for testing
symlinkedBuildkitAddr := filepath.Join(data.Temp().Path(), "buildkit.sock")
data.Labels().Set("symlinkedBuildkitAddr", symlinkedBuildkitAddr)
// Do a negative test to check the setup
helpers.Fail("builder", "prune", "--force", "--buildkit-host", fmt.Sprintf("unix://%s", symlinkedBuildkitAddr))
// Test build with the symlinked socket
cmd := helpers.Custom("ln", "-s", buildkitAddr, symlinkedBuildkitAddr)
cmd.Run(&test.Expected{
ExitCode: 0,
})
},
Command: func(data test.Data, helpers test.Helpers) test.TestableCommand {
return helpers.Command("builder", "prune", "--force", "--buildkit-host", fmt.Sprintf("unix://%s", data.Labels().Get("symlinkedBuildkitAddr")))
},
Expected: test.Expects(0, nil, nil),
},
{
Description: "builder with env",
NoParallel: true,
Require: require.Not(nerdtest.Docker),
Setup: func(data test.Data, helpers test.Helpers) {
// Get BuildkitAddr
buildkitAddr, err := buildkitutil.GetBuildkitHost(testutil.Namespace)
assert.NilError(helpers.T(), err)
buildkitAddr = strings.TrimPrefix(buildkitAddr, "unix://")
// Symlink the buildkit Socket for testing
symlinkedBuildkitAddr := filepath.Join(data.Temp().Path(), "buildkit-env.sock")
data.Labels().Set("symlinkedBuildkitAddr", symlinkedBuildkitAddr)
// Do a negative test to ensure setting up the env variable is effective
cmd := helpers.Command("builder", "prune", "--force")
cmd.Setenv("BUILDKIT_HOST", fmt.Sprintf("unix://%s", symlinkedBuildkitAddr))
cmd.Run(&test.Expected{ExitCode: expect.ExitCodeGenericFail})
// Symlink the buildkit socket for testing
cmd = helpers.Custom("ln", "-s", buildkitAddr, symlinkedBuildkitAddr)
cmd.Run(&test.Expected{
ExitCode: 0,
})
},
Command: func(data test.Data, helpers test.Helpers) test.TestableCommand {
symlinkedBuildkitAddr := data.Labels().Get("symlinkedBuildkitAddr")
cmd := helpers.Command("builder", "prune", "--force")
cmd.Setenv("BUILDKIT_HOST", fmt.Sprintf("unix://%s", symlinkedBuildkitAddr))
return cmd
},
Expected: test.Expects(0, nil, nil),
},
{
Description: "Debug",
// `nerdctl builder debug` is currently incompatible with `docker buildx debug`.
Require: require.All(require.Not(nerdtest.Docker)),
NoParallel: true,
Command: func(data test.Data, helpers test.Helpers) test.TestableCommand {
dockerfile := fmt.Sprintf(`FROM %s
CMD ["echo", "nerdctl-builder-debug-test-string"]`, testutil.CommonImage)
buildCtx := data.TempDir()
err := os.WriteFile(filepath.Join(buildCtx, "Dockerfile"), []byte(dockerfile), 0o600)
assert.NilError(helpers.T(), err)
cmd := helpers.Command("builder", "debug", buildCtx)
cmd.WithStdin(bytes.NewReader([]byte("c\n")))
data.Temp().Save(dockerfile, "Dockerfile")
cmd := helpers.Command("builder", "debug", data.Temp().Path())
cmd.Feed(strings.NewReader("c\n"))
return cmd
},
Expected: test.Expects(0, nil, nil),
},
{
Description: "WithPull",
NoParallel: true,
Setup: func(data test.Data, helpers test.Helpers) {
// FIXME: this test should be rewritten to dynamically retrieve the ids, and use images
// available on all platforms
oldImage := testutil.BusyboxImage
oldImageSha := "141c253bc4c3fd0a201d32dc1f493bcf3fff003b6df416dea4f41046e0f37d47"
parsedOldImage, err := referenceutil.Parse(oldImage)
assert.NilError(helpers.T(), err)
oldImageSha := parsedOldImage.Digest.String()
newImage := testutil.AlpineImage
newImageSha := "ec14c7992a97fc11425907e908340c6c3d6ff602f5f13d899e6b7027c9b4133a"
parsedNewImage, err := referenceutil.Parse(newImage)
assert.NilError(helpers.T(), err)
newImageSha := parsedNewImage.Digest.String()
helpers.Ensure("pull", "--quiet", oldImage)
helpers.Ensure("tag", oldImage, newImage)
helpers.Ensure("tag", oldImage, parsedNewImage.Domain+"/"+parsedNewImage.Path+":"+parsedNewImage.Tag)
dockerfile := fmt.Sprintf(`FROM %s`, newImage)
buildCtx := data.TempDir()
err := os.WriteFile(filepath.Join(buildCtx, "Dockerfile"), []byte(dockerfile), 0o600)
assert.NilError(helpers.T(), err)
data.Set("buildCtx", buildCtx)
data.Set("oldImageSha", oldImageSha)
data.Set("newImageSha", newImageSha)
dockerfile := fmt.Sprintf(`FROM %s`, parsedNewImage.Domain+"/"+parsedNewImage.Path+":"+parsedNewImage.Tag)
data.Temp().Save(dockerfile, "Dockerfile")
data.Labels().Set("oldImageSha", oldImageSha)
data.Labels().Set("newImageSha", newImageSha)
data.Labels().Set("base", data.Temp().Dir())
},
Cleanup: func(data test.Data, helpers test.Helpers) {
helpers.Anyhow("rmi", testutil.AlpineImage)
},
SubTests: []*test.Case{
{
Description: "pull false",
NoParallel: true,
Command: func(data test.Data, helpers test.Helpers) test.TestableCommand {
return helpers.Command("build", data.Get("buildCtx"), "--pull=false")
return helpers.Command("build", data.Labels().Get("base"), "--pull=false")
},
Expected: func(data test.Data, helpers test.Helpers) *test.Expected {
return &test.Expected{
Errors: []error{errors.New(data.Get("oldImageSha"))},
Errors: []error{errors.New(data.Labels().Get("oldImageSha"))},
}
},
},
@ -123,11 +191,11 @@ CMD ["echo", "nerdctl-builder-debug-test-string"]`, testutil.CommonImage)
Description: "pull true",
NoParallel: true,
Command: func(data test.Data, helpers test.Helpers) test.TestableCommand {
return helpers.Command("build", data.Get("buildCtx"), "--pull=true")
return helpers.Command("build", data.Labels().Get("base"), "--pull=true")
},
Expected: func(data test.Data, helpers test.Helpers) *test.Expected {
return &test.Expected{
Errors: []error{errors.New(data.Get("newImageSha"))},
Errors: []error{errors.New(data.Labels().Get("newImageSha"))},
}
},
},
@ -135,11 +203,11 @@ CMD ["echo", "nerdctl-builder-debug-test-string"]`, testutil.CommonImage)
Description: "no pull",
NoParallel: true,
Command: func(data test.Data, helpers test.Helpers) test.TestableCommand {
return helpers.Command("build", data.Get("buildCtx"))
return helpers.Command("build", data.Labels().Get("base"))
},
Expected: func(data test.Data, helpers test.Helpers) *test.Expected {
return &test.Expected{
Errors: []error{errors.New(data.Get("newImageSha"))},
Errors: []error{errors.New(data.Labels().Get("newImageSha"))},
}
},
},

View File

@ -164,6 +164,7 @@ func Platforms(cmd *cobra.Command, args []string, toComplete string) ([]string,
"riscv64",
"ppc64le",
"s390x",
"loong64",
"386",
"arm", // alias of "linux/arm/v7"
"linux/arm/v6", // "arm/v6" is invalid (interpreted as OS="arm", Arch="v7")

View File

@ -17,11 +17,15 @@
package completion
import (
"os/exec"
"testing"
"github.com/containerd/nerdctl/mod/tigron/expect"
"github.com/containerd/nerdctl/mod/tigron/require"
"github.com/containerd/nerdctl/mod/tigron/test"
"github.com/containerd/nerdctl/v2/pkg/testutil"
"github.com/containerd/nerdctl/v2/pkg/testutil/nerdtest"
"github.com/containerd/nerdctl/v2/pkg/testutil/test"
)
func TestMain(m *testing.M) {
@ -31,65 +35,69 @@ func TestMain(m *testing.M) {
func TestCompletion(t *testing.T) {
nerdtest.Setup()
// Note: some functions need to be tested without the automatic --namespace nerdctl-test argument, so we need
// to retrieve the binary name.
// Note that we know this works already, so no need to assert err.
bin, _ := exec.LookPath(testutil.GetTarget())
testCase := &test.Case{
Require: test.Not(nerdtest.Docker),
Require: require.Not(nerdtest.Docker),
Setup: func(data test.Data, helpers test.Helpers) {
identifier := data.Identifier()
helpers.Ensure("pull", "--quiet", testutil.CommonImage)
helpers.Ensure("network", "create", data.Identifier())
helpers.Ensure("volume", "create", data.Identifier())
data.Set("identifier", data.Identifier())
helpers.Ensure("network", "create", identifier)
helpers.Ensure("volume", "create", identifier)
data.Labels().Set("identifier", identifier)
},
Cleanup: func(data test.Data, helpers test.Helpers) {
helpers.Anyhow("network", "rm", data.Identifier())
helpers.Anyhow("volume", "rm", data.Identifier())
identifier := data.Identifier()
helpers.Anyhow("network", "rm", identifier)
helpers.Anyhow("volume", "rm", identifier)
},
SubTests: []*test.Case{
{
Description: "--cgroup-manager",
Require: test.Not(test.Windows),
Require: require.Not(require.Windows),
Command: test.Command("__complete", "--cgroup-manager", ""),
Expected: test.Expects(0, nil, test.Contains("cgroupfs\n")),
Expected: test.Expects(0, nil, expect.Contains("cgroupfs\n")),
},
{
Description: "--snapshotter",
Require: test.Not(test.Windows),
Require: require.Not(require.Windows),
Command: test.Command("__complete", "--snapshotter", ""),
Expected: test.Expects(0, nil, test.Contains("native\n")),
Expected: test.Expects(0, nil, expect.Contains("native\n")),
},
{
Description: "empty",
Command: test.Command("__complete", ""),
Expected: test.Expects(0, nil, test.Contains("run\t")),
Expected: test.Expects(0, nil, expect.Contains("run\t")),
},
{
Description: "build --network",
Command: test.Command("__complete", "build", "--network", ""),
Expected: test.Expects(0, nil, test.Contains("default\n")),
Expected: test.Expects(0, nil, expect.Contains("default\n")),
},
{
Description: "run -",
Command: test.Command("__complete", "run", "-"),
Expected: test.Expects(0, nil, test.Contains("--network\t")),
Expected: test.Expects(0, nil, expect.Contains("--network\t")),
},
{
Description: "run --n",
Command: test.Command("__complete", "run", "--n"),
Expected: test.Expects(0, nil, test.Contains("--network\t")),
Expected: test.Expects(0, nil, expect.Contains("--network\t")),
},
{
Description: "run --ne",
Command: test.Command("__complete", "run", "--ne"),
Expected: test.Expects(0, nil, test.Contains("--network\t")),
Expected: test.Expects(0, nil, expect.Contains("--network\t")),
},
{
Description: "run --net",
Command: test.Command("__complete", "run", "--net", ""),
Expected: func(data test.Data, helpers test.Helpers) *test.Expected {
return &test.Expected{
Output: test.All(
test.Contains("host\n"),
test.Contains(data.Get("identifier")+"\n"),
),
Output: expect.Contains("host\n", data.Labels().Get("identifier")+"\n"),
}
},
},
@ -98,10 +106,7 @@ func TestCompletion(t *testing.T) {
Command: test.Command("__complete", "run", "-it", "--net", ""),
Expected: func(data test.Data, helpers test.Helpers) *test.Expected {
return &test.Expected{
Output: test.All(
test.Contains("host\n"),
test.Contains(data.Get("identifier")+"\n"),
),
Output: expect.Contains("host\n", data.Labels().Get("identifier")+"\n"),
}
},
},
@ -110,37 +115,34 @@ func TestCompletion(t *testing.T) {
Command: test.Command("__complete", "run", "-it", "--rm", "--net", ""),
Expected: func(data test.Data, helpers test.Helpers) *test.Expected {
return &test.Expected{
Output: test.All(
test.Contains("host\n"),
test.Contains(data.Get("identifier")+"\n"),
),
Output: expect.Contains("host\n", data.Labels().Get("identifier")+"\n"),
}
},
},
{
Description: "run --restart",
Command: test.Command("__complete", "run", "--restart", ""),
Expected: test.Expects(0, nil, test.Contains("always\n")),
Expected: test.Expects(0, nil, expect.Contains("always\n")),
},
{
Description: "network --rm",
Command: test.Command("__complete", "network", "rm", ""),
Expected: func(data test.Data, helpers test.Helpers) *test.Expected {
return &test.Expected{
Output: test.All(
test.DoesNotContain("host\n"),
test.Contains(data.Get("identifier")+"\n"),
Output: expect.All(
expect.DoesNotContain("host\n"),
expect.Contains(data.Labels().Get("identifier")+"\n"),
),
}
},
},
{
Description: "run --cap-add",
Require: test.Not(test.Windows),
Require: require.Not(require.Windows),
Command: test.Command("__complete", "run", "--cap-add", ""),
Expected: test.Expects(0, nil, test.All(
test.Contains("sys_admin\n"),
test.DoesNotContain("CAP_SYS_ADMIN\n"),
Expected: test.Expects(0, nil, expect.All(
expect.Contains("sys_admin\n"),
expect.DoesNotContain("CAP_SYS_ADMIN\n"),
)),
},
{
@ -148,7 +150,7 @@ func TestCompletion(t *testing.T) {
Command: test.Command("__complete", "volume", "inspect", ""),
Expected: func(data test.Data, helpers test.Helpers) *test.Expected {
return &test.Expected{
Output: test.Contains(data.Get("identifier") + "\n"),
Output: expect.Contains(data.Labels().Get("identifier") + "\n"),
}
},
},
@ -157,55 +159,55 @@ func TestCompletion(t *testing.T) {
Command: test.Command("__complete", "volume", "rm", ""),
Expected: func(data test.Data, helpers test.Helpers) *test.Expected {
return &test.Expected{
Output: test.Contains(data.Get("identifier") + "\n"),
Output: expect.Contains(data.Labels().Get("identifier") + "\n"),
}
},
},
{
Description: "no namespace --cgroup-manager",
Require: test.Not(test.Windows),
Description: "--cgroup-manager",
Require: require.Not(require.Windows),
Command: func(data test.Data, helpers test.Helpers) test.TestableCommand {
return helpers.Custom("nerdctl", "__complete", "--cgroup-manager", "")
return helpers.Command("__complete", "--cgroup-manager", "")
},
Expected: test.Expects(0, nil, test.Contains("cgroupfs\n")),
Expected: test.Expects(0, nil, expect.Contains("cgroupfs\n")),
},
{
Description: "no namespace empty",
Description: "empty",
Command: func(data test.Data, helpers test.Helpers) test.TestableCommand {
return helpers.Custom("nerdctl", "__complete", "")
return helpers.Command("__complete", "")
},
Expected: test.Expects(0, nil, test.Contains("run\t")),
Expected: test.Expects(0, nil, expect.Contains("run\t")),
},
{
Description: "namespace space empty",
Command: func(data test.Data, helpers test.Helpers) test.TestableCommand {
// mind {"--namespace=nerdctl-test"} vs {"--namespace", "nerdctl-test"}
return helpers.Custom("nerdctl", "__complete", "--namespace", string(helpers.Read(nerdtest.Namespace)), "")
return helpers.Custom(bin, "__complete", "--namespace", string(helpers.Read(nerdtest.Namespace)), "")
},
Expected: test.Expects(0, nil, test.Contains("run\t")),
Expected: test.Expects(0, nil, expect.Contains("run\t")),
},
{
Description: "run -i",
Command: test.Command("__complete", "run", "-i", ""),
Expected: test.Expects(0, nil, test.Contains(testutil.CommonImage)),
Expected: test.Expects(0, nil, expect.Contains(testutil.CommonImage)),
},
{
Description: "run -it",
Command: test.Command("__complete", "run", "-it", ""),
Expected: test.Expects(0, nil, test.Contains(testutil.CommonImage)),
Expected: test.Expects(0, nil, expect.Contains(testutil.CommonImage)),
},
{
Description: "run -it --rm",
Command: test.Command("__complete", "run", "-it", "--rm", ""),
Expected: test.Expects(0, nil, test.Contains(testutil.CommonImage)),
Expected: test.Expects(0, nil, expect.Contains(testutil.CommonImage)),
},
{
Description: "namespace run -i",
Command: func(data test.Data, helpers test.Helpers) test.TestableCommand {
// mind {"--namespace=nerdctl-test"} vs {"--namespace", "nerdctl-test"}
return helpers.Custom("nerdctl", "__complete", "--namespace", string(helpers.Read(nerdtest.Namespace)), "run", "-i", "")
return helpers.Custom(bin, "__complete", "--namespace", string(helpers.Read(nerdtest.Namespace)), "run", "-i", "")
},
Expected: test.Expects(0, nil, test.Contains(testutil.CommonImage+"\n")),
Expected: test.Expects(0, nil, expect.Contains(testutil.CommonImage+"\n")),
},
},
}

View File

@ -38,6 +38,49 @@ func IPAMDrivers(cmd *cobra.Command, args []string, toComplete string) ([]string
return []string{"default", "host-local", "dhcp"}, cobra.ShellCompDirectiveNoFileComp
}
func NetworkOptions(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) {
driver, _ := cmd.Flags().GetString("driver")
if driver == "" {
driver = "bridge"
}
var candidates []string
switch driver {
case "bridge":
candidates = []string{
"mtu=",
"com.docker.network.driver.mtu=",
"ip-masq=",
"com.docker.network.bridge.enable_ip_masquerade=",
}
case "macvlan":
candidates = []string{
"mtu=",
"com.docker.network.driver.mtu=",
"mode=bridge",
"macvlan_mode=bridge",
"parent=",
}
case "ipvlan":
candidates = []string{
"mtu=",
"com.docker.network.driver.mtu=",
"mode=l2",
"mode=l3",
"ipvlan_mode=l2",
"ipvlan_mode=l3",
"parent=",
}
default:
candidates = []string{
"mtu=",
"com.docker.network.driver.mtu=",
"parent=",
}
}
return candidates, cobra.ShellCompDirectiveNoSpace
}
func NamespaceNames(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) {
globalOptions, err := helpers.ProcessRootCmdFlags(cmd)
if err != nil {

View File

@ -1,3 +1,5 @@
//go:build unix && !linux
/*
Copyright The containerd Authors.

View File

@ -38,3 +38,25 @@ func NetworkDrivers(cmd *cobra.Command, args []string, toComplete string) ([]str
func IPAMDrivers(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) {
return []string{"default"}, cobra.ShellCompDirectiveNoFileComp
}
func NetworkOptions(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) {
driver, _ := cmd.Flags().GetString("driver")
if driver == "" {
driver = "nat"
}
var candidates []string
switch driver {
case "nat":
candidates = []string{
"mtu=",
"com.docker.network.driver.mtu=",
}
default:
candidates = []string{
"mtu=",
"com.docker.network.driver.mtu=",
}
}
return candidates, cobra.ShellCompDirectiveNoSpace
}

View File

@ -23,8 +23,8 @@ import (
"github.com/containerd/nerdctl/v2/pkg/composer"
)
func NewComposeCommand() *cobra.Command {
var composeCommand = &cobra.Command{
func Command() *cobra.Command {
var cmd = &cobra.Command{
Use: "compose [flags] COMMAND",
Short: "Compose",
RunE: helpers.UnknownSubcommandAction,
@ -33,40 +33,40 @@ func NewComposeCommand() *cobra.Command {
TraverseChildren: true, // required for global short hands like -f
}
// `-f` is a nonPersistentAlias, as it conflicts with `nerdctl compose logs --follow`
helpers.AddPersistentStringArrayFlag(composeCommand, "file", nil, []string{"f"}, nil, "", "Specify an alternate compose file")
composeCommand.PersistentFlags().String("project-directory", "", "Specify an alternate working directory")
composeCommand.PersistentFlags().StringP("project-name", "p", "", "Specify an alternate project name")
composeCommand.PersistentFlags().String("env-file", "", "Specify an alternate environment file")
composeCommand.PersistentFlags().String("ipfs-address", "", "multiaddr of IPFS API (default uses $IPFS_PATH env variable if defined or local directory ~/.ipfs)")
composeCommand.PersistentFlags().StringArray("profile", []string{}, "Specify a profile to enable")
helpers.AddPersistentStringArrayFlag(cmd, "file", nil, []string{"f"}, nil, "", "Specify an alternate compose file")
cmd.PersistentFlags().String("project-directory", "", "Specify an alternate working directory")
cmd.PersistentFlags().StringP("project-name", "p", "", "Specify an alternate project name")
cmd.PersistentFlags().String("env-file", "", "Specify an alternate environment file")
cmd.PersistentFlags().String("ipfs-address", "", "multiaddr of IPFS API (default uses $IPFS_PATH env variable if defined or local directory ~/.ipfs)")
cmd.PersistentFlags().StringArray("profile", []string{}, "Specify a profile to enable")
composeCommand.AddCommand(
newComposeUpCommand(),
newComposeLogsCommand(),
newComposeConfigCommand(),
newComposeCopyCommand(),
newComposeBuildCommand(),
newComposeExecCommand(),
newComposeImagesCommand(),
newComposePortCommand(),
newComposePushCommand(),
newComposePullCommand(),
newComposeDownCommand(),
newComposePsCommand(),
newComposeKillCommand(),
newComposeRestartCommand(),
newComposeRemoveCommand(),
newComposeRunCommand(),
newComposeVersionCommand(),
newComposeStartCommand(),
newComposeStopCommand(),
newComposePauseCommand(),
newComposeUnpauseCommand(),
newComposeTopCommand(),
newComposeCreateCommand(),
cmd.AddCommand(
upCommand(),
logsCommand(),
configCommand(),
copyCommand(),
buildCommand(),
execCommand(),
imagesCommand(),
portCommand(),
pushCommand(),
pullCommand(),
downCommand(),
psCommand(),
killCommand(),
restartCommand(),
removeCommand(),
runCommand(),
versionCommand(),
startCommand(),
stopCommand(),
pauseCommand(),
unpauseCommand(),
topCommand(),
createCommand(),
)
return composeCommand
return cmd
}
func getComposeOptions(cmd *cobra.Command, debugFull, experimental bool) (composer.Options, error) {

View File

@ -25,22 +25,22 @@ import (
"github.com/containerd/nerdctl/v2/pkg/composer"
)
func newComposeBuildCommand() *cobra.Command {
var composeBuildCommand = &cobra.Command{
func buildCommand() *cobra.Command {
var cmd = &cobra.Command{
Use: "build [flags] [SERVICE...]",
Short: "Build or rebuild services",
RunE: composeBuildAction,
RunE: buildAction,
SilenceUsage: true,
SilenceErrors: true,
}
composeBuildCommand.Flags().StringArray("build-arg", nil, "Set build-time variables for services.")
composeBuildCommand.Flags().Bool("no-cache", false, "Do not use cache when building the image.")
composeBuildCommand.Flags().String("progress", "", "Set type of progress output (auto, plain, tty). Use plain to show container output")
cmd.Flags().StringArray("build-arg", nil, "Set build-time variables for services.")
cmd.Flags().Bool("no-cache", false, "Do not use cache when building the image.")
cmd.Flags().String("progress", "", "Set type of progress output (auto, plain, tty). Use plain to show container output")
return composeBuildCommand
return cmd
}
func composeBuildAction(cmd *cobra.Command, args []string) error {
func buildAction(cmd *cobra.Command, args []string) error {
globalOptions, err := helpers.ProcessRootCmdFlags(cmd)
if err != nil {
return err

View File

@ -17,57 +17,114 @@
package compose
import (
"errors"
"fmt"
"testing"
"github.com/containerd/nerdctl/mod/tigron/expect"
"github.com/containerd/nerdctl/mod/tigron/test"
"github.com/containerd/nerdctl/v2/pkg/testutil"
"github.com/containerd/nerdctl/v2/pkg/testutil/nerdtest"
)
func TestComposeBuild(t *testing.T) {
const imageSvc0 = "composebuild_svc0"
const imageSvc1 = "composebuild_svc1"
dockerfile := "FROM " + testutil.CommonImage
dockerComposeYAML := fmt.Sprintf(`
testCase := nerdtest.Setup()
testCase.Require = nerdtest.Build
testCase.Setup = func(data test.Data, helpers test.Helpers) {
// Make sure we shard the image name to something unique to the test to avoid conflicts with other tests
imageSvc0 := data.Identifier("svc0")
imageSvc1 := data.Identifier("svc1")
// We are not going to run them, so, ports conflicts should not matter here
dockerComposeYAML := fmt.Sprintf(`
services:
svc0:
build: .
image: %s
ports:
- 8080:80
depends_on:
- svc1
svc1:
build: .
image: %s
ports:
- 8081:80
`, imageSvc0, imageSvc1)
dockerfile := fmt.Sprintf(`FROM %s`, testutil.AlpineImage)
data.Temp().Save(dockerComposeYAML, "compose.yaml")
data.Temp().Save(dockerfile, "Dockerfile")
testutil.RequiresBuild(t)
testutil.RegisterBuildCacheCleanup(t)
base := testutil.NewBase(t)
data.Labels().Set("composeYaml", data.Temp().Path("compose.yaml"))
data.Labels().Set("imageSvc0", imageSvc0)
data.Labels().Set("imageSvc1", imageSvc1)
}
comp := testutil.NewComposeDir(t, dockerComposeYAML)
defer comp.CleanUp()
comp.WriteFile("Dockerfile", dockerfile)
projectName := comp.ProjectName()
t.Logf("projectName=%q", projectName)
testCase.SubTests = []*test.Case{
{
Description: "build svc0",
NoParallel: true,
Setup: func(data test.Data, helpers test.Helpers) {
helpers.Ensure("compose", "-f", data.Labels().Get("composeYaml"), "build", "svc0")
},
defer base.Cmd("rmi", imageSvc0).Run()
defer base.Cmd("rmi", imageSvc1).Run()
Command: test.Command("images"),
// 1. build only 1 service without triggering the dependency service build
base.ComposeCmd("-f", comp.YAMLFullPath(), "build", "svc0").AssertOK()
base.Cmd("images").AssertOutContains(imageSvc0)
base.Cmd("images").AssertOutNotContains(imageSvc1)
// 2. build multiple services
base.ComposeCmd("-f", comp.YAMLFullPath(), "build", "svc0", "svc1").AssertOK()
base.Cmd("images").AssertOutContains(imageSvc0)
base.Cmd("images").AssertOutContains(imageSvc1)
// 3. build all if no args are given
base.ComposeCmd("-f", comp.YAMLFullPath(), "build").AssertOK()
// 4. fail if some services args not exist in compose.yml
base.ComposeCmd("-f", comp.YAMLFullPath(), "build", "svc0", "svc100").AssertFail()
Expected: func(data test.Data, helpers test.Helpers) *test.Expected {
return &test.Expected{
Output: expect.All(
expect.Contains(data.Labels().Get("imageSvc0")),
expect.DoesNotContain(data.Labels().Get("imageSvc1")),
),
}
},
},
{
Description: "build svc0 and svc1",
NoParallel: true,
Setup: func(data test.Data, helpers test.Helpers) {
helpers.Ensure("compose", "-f", data.Labels().Get("composeYaml"), "build", "svc0", "svc1")
},
Command: test.Command("images"),
Expected: func(data test.Data, helpers test.Helpers) *test.Expected {
return &test.Expected{
Output: expect.Contains(data.Labels().Get("imageSvc0"), data.Labels().Get("imageSvc1")),
}
},
},
{
Description: "build no arg",
Command: func(data test.Data, helpers test.Helpers) test.TestableCommand {
return helpers.Command("compose", "-f", data.Labels().Get("composeYaml"), "build")
},
Expected: test.Expects(expect.ExitCodeSuccess, nil, nil),
},
{
Description: "build bogus",
Command: func(data test.Data, helpers test.Helpers) test.TestableCommand {
return helpers.Command(
"compose",
"-f",
data.Labels().Get("composeYaml"),
"build",
"svc0",
"svc100",
)
},
Expected: test.Expects(1, []error{errors.New("no such service: svc100")}, nil),
},
}
testCase.Cleanup = func(data test.Data, helpers test.Helpers) {
if data.Labels().Get("imageSvc0") != "" {
helpers.Anyhow("rmi", data.Labels().Get("imageSvc0"), data.Labels().Get("imageSvc1"))
}
}
testCase.Run(t)
}

View File

@ -27,25 +27,25 @@ import (
"github.com/containerd/nerdctl/v2/pkg/composer"
)
func newComposeConfigCommand() *cobra.Command {
var composeConfigCommand = &cobra.Command{
func configCommand() *cobra.Command {
var cmd = &cobra.Command{
Use: "config",
Short: "Validate and view the Compose file",
RunE: composeConfigAction,
RunE: configAction,
SilenceUsage: true,
SilenceErrors: true,
}
composeConfigCommand.Flags().BoolP("quiet", "q", false, "Only validate the configuration, don't print anything.")
composeConfigCommand.Flags().Bool("services", false, "Print the service names, one per line.")
composeConfigCommand.Flags().Bool("volumes", false, "Print the volume names, one per line.")
composeConfigCommand.Flags().String("hash", "", "Print the service config hash, one per line.")
composeConfigCommand.RegisterFlagCompletionFunc("hash", func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) {
cmd.Flags().BoolP("quiet", "q", false, "Only validate the configuration, don't print anything.")
cmd.Flags().Bool("services", false, "Print the service names, one per line.")
cmd.Flags().Bool("volumes", false, "Print the volume names, one per line.")
cmd.Flags().String("hash", "", "Print the service config hash, one per line.")
cmd.RegisterFlagCompletionFunc("hash", func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) {
return []string{"\"*\""}, cobra.ShellCompDirectiveNoFileComp
})
return composeConfigCommand
return cmd
}
func composeConfigAction(cmd *cobra.Command, args []string) error {
func configAction(cmd *cobra.Command, args []string) error {
globalOptions, err := helpers.ProcessRootCmdFlags(cmd)
if err != nil {
return err

View File

@ -18,141 +18,275 @@ package compose
import (
"fmt"
"os"
"path/filepath"
"testing"
"gotest.tools/v3/assert"
"github.com/containerd/nerdctl/mod/tigron/expect"
"github.com/containerd/nerdctl/mod/tigron/test"
"github.com/containerd/nerdctl/mod/tigron/tig"
"github.com/containerd/nerdctl/v2/pkg/testutil"
"github.com/containerd/nerdctl/v2/pkg/testutil/nerdtest"
)
func TestComposeConfig(t *testing.T) {
base := testutil.NewBase(t)
var dockerComposeYAML = `
dockerComposeYAML := fmt.Sprintf(`
services:
hello:
image: alpine:3.13
`
image: %s
`, testutil.CommonImage)
comp := testutil.NewComposeDir(t, dockerComposeYAML)
defer comp.CleanUp()
testCase := nerdtest.Setup()
base.ComposeCmd("-f", comp.YAMLFullPath(), "config").AssertOutContains("hello:")
}
testCase.Setup = func(data test.Data, helpers test.Helpers) {
data.Temp().Save(dockerComposeYAML, "compose.yaml")
data.Labels().Set("composeYaml", data.Temp().Path("compose.yaml"))
}
func TestComposeConfigWithPrintService(t *testing.T) {
base := testutil.NewBase(t)
testCase.SubTests = []*test.Case{
{
Description: "config contains service name",
Command: func(data test.Data, helpers test.Helpers) test.TestableCommand {
return helpers.Command("compose", "-f", data.Labels().Get("composeYaml"), "config")
},
Expected: test.Expects(expect.ExitCodeSuccess, nil, expect.Contains("hello:")),
},
{
Description: "config --services is exactly service name",
Command: func(data test.Data, helpers test.Helpers) test.TestableCommand {
return helpers.Command(
"compose",
"-f",
data.Labels().Get("composeYaml"),
"config",
"--services",
)
},
Expected: test.Expects(expect.ExitCodeSuccess, nil, expect.Equals("hello\n")),
},
{
Description: "config --hash=* contains service name",
Command: func(data test.Data, helpers test.Helpers) test.TestableCommand {
return helpers.Command("compose", "-f", data.Labels().Get("composeYaml"), "config", "--hash=*")
},
Expected: test.Expects(expect.ExitCodeSuccess, nil, expect.Contains("hello")),
},
}
var dockerComposeYAML = `
services:
hello1:
image: alpine:3.13
`
comp := testutil.NewComposeDir(t, dockerComposeYAML)
defer comp.CleanUp()
base.ComposeCmd("-f", comp.YAMLFullPath(), "config", "--services").AssertOutExactly("hello1\n")
testCase.Run(t)
}
func TestComposeConfigWithPrintServiceHash(t *testing.T) {
base := testutil.NewBase(t)
var dockerComposeYAML = `
const dockerComposeYAML = `
services:
hello1:
hello:
image: alpine:%s
`
testCase := nerdtest.Setup()
comp := testutil.NewComposeDir(t, fmt.Sprintf(dockerComposeYAML, "3.13"))
defer comp.CleanUp()
testCase.Setup = func(data test.Data, helpers test.Helpers) {
data.Temp().Save(fmt.Sprintf(dockerComposeYAML, "3.13"), "compose.yaml")
// `--hash=*` is broken in Docker Compose v2.23.0: https://github.com/docker/compose/issues/11145
if base.Target == testutil.Nerdctl {
base.ComposeCmd("-f", comp.YAMLFullPath(), "config", "--hash=*").AssertOutContains("hello1")
hash := helpers.Capture(
"compose",
"-f",
data.Temp().Path("compose.yaml"),
"config",
"--hash=hello",
)
data.Labels().Set("hash", hash)
data.Temp().Save(fmt.Sprintf(dockerComposeYAML, "3.14"), "compose.yaml")
}
hash := base.ComposeCmd("-f", comp.YAMLFullPath(), "config", "--hash=hello1").Out()
testCase.Command = func(data test.Data, helpers test.Helpers) test.TestableCommand {
return helpers.Command(
"compose",
"-f",
data.Temp().Path("compose.yaml"),
"config",
"--hash=hello",
)
}
newComp := testutil.NewComposeDir(t, fmt.Sprintf(dockerComposeYAML, "3.14"))
defer newComp.CleanUp()
testCase.Expected = func(data test.Data, helpers test.Helpers) *test.Expected {
return &test.Expected{
ExitCode: 0,
Output: func(stdout string, t tig.T) {
assert.Assert(t, data.Labels().Get("hash") != stdout, "hash should be different")
},
}
}
newHash := base.ComposeCmd("-f", newComp.YAMLFullPath(), "config", "--hash=hello1").Out()
assert.Assert(t, hash != newHash)
testCase.Run(t)
}
func TestComposeConfigWithMultipleFile(t *testing.T) {
base := testutil.NewBase(t)
var dockerComposeYAML = `
const dockerComposeBase = `
services:
hello1:
image: alpine:3.13
`
comp := testutil.NewComposeDir(t, dockerComposeYAML)
defer comp.CleanUp()
comp.WriteFile("docker-compose.test.yml", `
const dockerComposeTest = `
services:
hello2:
image: alpine:3.14
`)
comp.WriteFile("docker-compose.override.yml", `
`
const dockerComposeOverride = `
services:
hello1:
image: alpine:3.14
`)
`
base.ComposeCmd("-f", comp.YAMLFullPath(), "-f", filepath.Join(comp.Dir(), "docker-compose.test.yml"), "config").AssertOutContains("alpine:3.14")
base.ComposeCmd("--project-directory", comp.Dir(), "config", "--services").AssertOutExactly("hello1\n")
base.ComposeCmd("--project-directory", comp.Dir(), "config").AssertOutContains("alpine:3.14")
testCase := nerdtest.Setup()
testCase.Setup = func(data test.Data, helpers test.Helpers) {
data.Temp().Save(dockerComposeBase, "compose.yaml")
data.Temp().Save(dockerComposeTest, "docker-compose.test.yml")
data.Temp().Save(dockerComposeOverride, "docker-compose.override.yml")
data.Labels().Set("composeDir", data.Temp().Path())
data.Labels().Set("composeYaml", data.Temp().Path("compose.yaml"))
data.Labels().Set("composeYamlTest", data.Temp().Path("docker-compose.test.yml"))
}
testCase.SubTests = []*test.Case{
{
Description: "config override",
Command: func(data test.Data, helpers test.Helpers) test.TestableCommand {
return helpers.Command(
"compose",
"-f", data.Labels().Get("composeYaml"),
"-f", data.Labels().Get("composeYamlTest"),
"config",
)
},
Expected: test.Expects(
expect.ExitCodeSuccess,
nil,
expect.Contains("alpine:3.13", "alpine:3.14", "hello1", "hello2"),
),
},
{
Description: "project dir",
Command: func(data test.Data, helpers test.Helpers) test.TestableCommand {
return helpers.Command(
"compose",
"--project-directory", data.Labels().Get("composeDir"), "config",
)
},
Expected: test.Expects(expect.ExitCodeSuccess, nil, expect.Contains("alpine:3.14")),
},
{
Description: "project dir services",
Command: func(data test.Data, helpers test.Helpers) test.TestableCommand {
return helpers.Command(
"compose",
"--project-directory", data.Labels().Get("composeDir"), "config", "--services",
)
},
Expected: test.Expects(expect.ExitCodeSuccess, nil, expect.Equals("hello1\n")),
},
}
testCase.Run(t)
}
func TestComposeConfigWithComposeFileEnv(t *testing.T) {
base := testutil.NewBase(t)
var dockerComposeYAML = `
const dockerComposeBase = `
services:
hello1:
image: alpine:3.13
`
comp := testutil.NewComposeDir(t, dockerComposeYAML)
defer comp.CleanUp()
comp.WriteFile("docker-compose.test.yml", `
const dockerComposeTest = `
services:
hello2:
image: alpine:3.14
`)
`
base.Env = append(base.Env, "COMPOSE_FILE="+comp.YAMLFullPath()+","+filepath.Join(comp.Dir(), "docker-compose.test.yml"), "COMPOSE_PATH_SEPARATOR=,")
testCase := nerdtest.Setup()
base.ComposeCmd("config").AssertOutContains("alpine:3.14")
base.ComposeCmd("--project-directory", comp.Dir(), "config", "--services").AssertOutContainsAll("hello1\n", "hello2\n")
base.ComposeCmd("--project-directory", comp.Dir(), "config").AssertOutContains("alpine:3.14")
testCase.Setup = func(data test.Data, helpers test.Helpers) {
data.Temp().Save(dockerComposeBase, "compose.yaml")
data.Temp().Save(dockerComposeTest, "docker-compose.test.yml")
data.Labels().Set("composeDir", data.Temp().Path())
data.Labels().Set("composeYaml", data.Temp().Path("compose.yaml"))
data.Labels().Set("composeYamlTest", data.Temp().Path("docker-compose.test.yml"))
}
testCase.SubTests = []*test.Case{
{
Description: "env config",
Command: func(data test.Data, helpers test.Helpers) test.TestableCommand {
cmd := helpers.Command(
"compose",
"config",
)
cmd.Setenv("COMPOSE_FILE", data.Labels().Get("composeYaml")+","+data.Labels().Get("composeYamlTest"))
cmd.Setenv("COMPOSE_PATH_SEPARATOR", ",")
return cmd
},
Expected: test.Expects(
expect.ExitCodeSuccess,
nil,
expect.Contains("alpine:3.13", "alpine:3.14", "hello1", "hello2"),
),
},
{
Description: "env with project dir",
Command: func(data test.Data, helpers test.Helpers) test.TestableCommand {
cmd := helpers.Command(
"compose",
"--project-directory", data.Labels().Get("composeDir"),
"config",
)
cmd.Setenv("COMPOSE_FILE", data.Labels().Get("composeYaml")+","+data.Labels().Get("composeYamlTest"))
cmd.Setenv("COMPOSE_PATH_SEPARATOR", ",")
return cmd
},
Expected: test.Expects(
expect.ExitCodeSuccess,
nil,
expect.Contains("alpine:3.13", "alpine:3.14", "hello1", "hello2"),
),
},
}
testCase.Run(t)
}
func TestComposeConfigWithEnvFile(t *testing.T) {
base := testutil.NewBase(t)
const dockerComposeYAML = `
services:
hello:
image: ${image}
`
comp := testutil.NewComposeDir(t, dockerComposeYAML)
defer comp.CleanUp()
envFile := filepath.Join(comp.Dir(), "env")
const envFileContent = `
image: hello-world
`
assert.NilError(t, os.WriteFile(envFile, []byte(envFileContent), 0644))
base.ComposeCmd("-f", comp.YAMLFullPath(), "--env-file", envFile, "config").AssertOutContains("image: hello-world")
testCase := nerdtest.Setup()
testCase.Setup = func(data test.Data, helpers test.Helpers) {
data.Temp().Save(dockerComposeYAML, "compose.yaml")
data.Temp().Save(envFileContent, "env")
}
testCase.Command = func(data test.Data, helpers test.Helpers) test.TestableCommand {
return helpers.Command("compose",
"-f", data.Temp().Path("compose.yaml"),
"--env-file", data.Temp().Path("env"),
"config",
)
}
testCase.Expected = test.Expects(expect.ExitCodeSuccess, nil, expect.Contains("image: hello-world"))
testCase.Run(t)
}

View File

@ -28,24 +28,24 @@ import (
"github.com/containerd/nerdctl/v2/pkg/rootlessutil"
)
func newComposeCopyCommand() *cobra.Command {
func copyCommand() *cobra.Command {
usage := `cp [OPTIONS] SERVICE:SRC_PATH DEST_PATH|-
nerdctl compose cp [OPTIONS] SRC_PATH|- SERVICE:DEST_PATH`
var composeCpCommand = &cobra.Command{
var cmd = &cobra.Command{
Use: usage,
Short: "Copy files/folders between a service container and the local filesystem",
Args: cobra.ExactArgs(2),
RunE: composeCopyAction,
RunE: copyAction,
SilenceUsage: true,
SilenceErrors: true,
}
composeCpCommand.Flags().Bool("dry-run", false, "Execute command in dry run mode")
composeCpCommand.Flags().BoolP("follow-link", "L", false, "Always follow symbol link in SRC_PATH")
composeCpCommand.Flags().Int("index", 0, "index of the container if service has multiple replicas")
return composeCpCommand
cmd.Flags().Bool("dry-run", false, "Execute command in dry run mode")
cmd.Flags().BoolP("follow-link", "L", false, "Always follow symbol link in SRC_PATH")
cmd.Flags().Int("index", 0, "index of the container if service has multiple replicas")
return cmd
}
func composeCopyAction(cmd *cobra.Command, args []string) error {
func copyAction(cmd *cobra.Command, args []string) error {
globalOptions, err := helpers.ProcessRootCmdFlags(cmd)
if err != nil {
return err
@ -71,15 +71,15 @@ func composeCopyAction(cmd *cobra.Command, args []string) error {
if err != nil {
return err
}
address := globalOptions.Address
// rootless cp runs in the host namespaces, so the address is different
if rootlessutil.IsRootless() {
address, err = rootlessutil.RootlessContainredSockAddress()
globalOptions.Address, err = rootlessutil.RootlessContainredSockAddress()
if err != nil {
return err
}
}
client, ctx, cancel, err := clientutil.NewClient(cmd.Context(), globalOptions.Namespace, address)
client, ctx, cancel, err := clientutil.NewClient(cmd.Context(), globalOptions.Namespace, globalOptions.Address)
if err != nil {
return err
}

View File

@ -18,52 +18,74 @@ package compose
import (
"fmt"
"os"
"path/filepath"
"testing"
"gotest.tools/v3/assert"
"github.com/containerd/nerdctl/mod/tigron/expect"
"github.com/containerd/nerdctl/mod/tigron/test"
"github.com/containerd/nerdctl/mod/tigron/tig"
"github.com/containerd/nerdctl/v2/pkg/testutil"
"github.com/containerd/nerdctl/v2/pkg/testutil/nerdtest"
)
func TestComposeCopy(t *testing.T) {
base := testutil.NewBase(t)
var dockerComposeYAML = fmt.Sprintf(`
version: '3.1'
services:
svc0:
image: %s
command: "sleep infinity"
`, testutil.CommonImage)
comp := testutil.NewComposeDir(t, dockerComposeYAML)
defer comp.CleanUp()
projectName := comp.ProjectName()
t.Logf("projectName=%q", projectName)
const testFileContent = "test-file-content"
base.ComposeCmd("-f", comp.YAMLFullPath(), "up", "-d").AssertOK()
defer base.ComposeCmd("-f", comp.YAMLFullPath(), "down", "-v").AssertOK()
testCase := nerdtest.Setup()
// gernetate test file
srcDir := t.TempDir()
srcFile := filepath.Join(srcDir, "test-file")
srcFileContent := []byte("test-file-content")
err := os.WriteFile(srcFile, srcFileContent, 0o644)
assert.NilError(t, err)
testCase.Setup = func(data test.Data, helpers test.Helpers) {
compYamlPath := data.Temp().Save(dockerComposeYAML, "compose.yaml")
helpers.Ensure("compose", "-f", compYamlPath, "up", "-d")
// test copy to service
destPath := "/dest-no-exist-no-slash"
base.ComposeCmd("-f", comp.YAMLFullPath(), "cp", srcFile, "svc0:"+destPath).AssertOK()
srcFilePath := data.Temp().Save(testFileContent, "test-file")
// test copy from service
destFile := filepath.Join(srcDir, "test-file2")
base.ComposeCmd("-f", comp.YAMLFullPath(), "cp", "svc0:"+destPath, destFile).AssertOK()
data.Labels().Set("composeYaml", compYamlPath)
data.Labels().Set("srcFile", srcFilePath)
}
destFileContent, err := os.ReadFile(destFile)
assert.NilError(t, err)
assert.DeepEqual(t, srcFileContent, destFileContent)
testCase.Cleanup = func(data test.Data, helpers test.Helpers) {
helpers.Anyhow("compose", "-f", data.Temp().Path("compose.yaml"), "down", "-v")
}
testCase.SubTests = []*test.Case{
{
Description: "test copy to service /dest-no-exist-no-slash",
// These are expected to run in sequence
NoParallel: true,
Command: func(data test.Data, helpers test.Helpers) test.TestableCommand {
return helpers.Command("compose",
"-f", data.Labels().Get("composeYaml"),
"cp", data.Labels().Get("srcFile"), "svc0:/dest-no-exist-no-slash")
},
Expected: test.Expects(expect.ExitCodeSuccess, nil, nil),
},
{
Description: "test copy from service test-file2",
NoParallel: true,
Command: func(data test.Data, helpers test.Helpers) test.TestableCommand {
return helpers.Command("compose",
"-f", data.Labels().Get("composeYaml"),
"cp", "svc0:/dest-no-exist-no-slash", data.Temp().Path("test-file2"))
},
Expected: func(data test.Data, helpers test.Helpers) *test.Expected {
return &test.Expected{
Output: func(stdout string, t tig.T) {
copied := data.Temp().Load("test-file2")
assert.Equal(t, copied, testFileContent)
},
}
},
},
}
testCase.Run(t)
}

View File

@ -27,23 +27,23 @@ import (
"github.com/containerd/nerdctl/v2/pkg/composer"
)
func newComposeCreateCommand() *cobra.Command {
var composeCreateCommand = &cobra.Command{
func createCommand() *cobra.Command {
var cmd = &cobra.Command{
Use: "create [flags] [SERVICE...]",
Short: "Creates containers for one or more services",
RunE: composeCreateAction,
RunE: createAction,
SilenceUsage: true,
SilenceErrors: true,
}
composeCreateCommand.Flags().Bool("build", false, "Build images before starting containers.")
composeCreateCommand.Flags().Bool("no-build", false, "Don't build an image even if it's missing, conflict with --build.")
composeCreateCommand.Flags().Bool("force-recreate", false, "Recreate containers even if their configuration and image haven't changed.")
composeCreateCommand.Flags().Bool("no-recreate", false, "Don't recreate containers if they exist, conflict with --force-recreate.")
composeCreateCommand.Flags().String("pull", "missing", "Pull images before running. (support always|missing|never)")
return composeCreateCommand
cmd.Flags().Bool("build", false, "Build images before starting containers.")
cmd.Flags().Bool("no-build", false, "Don't build an image even if it's missing, conflict with --build.")
cmd.Flags().Bool("force-recreate", false, "Recreate containers even if their configuration and image haven't changed.")
cmd.Flags().Bool("no-recreate", false, "Don't recreate containers if they exist, conflict with --force-recreate.")
cmd.Flags().String("pull", "missing", "Pull images before running. (support always|missing|never)")
return cmd
}
func composeCreateAction(cmd *cobra.Command, args []string) error {
func createAction(cmd *cobra.Command, args []string) error {
globalOptions, err := helpers.ProcessRootCmdFlags(cmd)
if err != nil {
return err
@ -65,7 +65,7 @@ func composeCreateAction(cmd *cobra.Command, args []string) error {
}
noRecreate, err := cmd.Flags().GetBool("no-recreate")
if err != nil {
return nil
return err
}
if forceRecreate && noRecreate {
return errors.New("flag --force-recreate and --no-recreate cannot be specified together")

View File

@ -18,40 +18,74 @@ package compose
import (
"fmt"
"strings"
"testing"
"gotest.tools/v3/assert"
"github.com/containerd/nerdctl/mod/tigron/expect"
"github.com/containerd/nerdctl/mod/tigron/test"
"github.com/containerd/nerdctl/mod/tigron/tig"
"github.com/containerd/nerdctl/v2/pkg/testutil"
"github.com/containerd/nerdctl/v2/pkg/testutil/nerdtest"
)
func TestComposeCreate(t *testing.T) {
base := testutil.NewBase(t)
var dockerComposeYAML = fmt.Sprintf(`
version: '3.1'
services:
svc0:
image: %s
`, testutil.AlpineImage)
`, testutil.CommonImage)
comp := testutil.NewComposeDir(t, dockerComposeYAML)
defer comp.CleanUp()
projectName := comp.ProjectName()
t.Logf("projectName=%q", projectName)
testCase := nerdtest.Setup()
defer base.ComposeCmd("-f", comp.YAMLFullPath(), "down", "-v").AssertOK()
testCase.Setup = func(data test.Data, helpers test.Helpers) {
compYamlPath := data.Temp().Save(dockerComposeYAML, "compose.yaml")
data.Labels().Set("composeYaml", compYamlPath)
}
// 1.1 `compose create` should create service container (in `created` status)
base.ComposeCmd("-f", comp.YAMLFullPath(), "create").AssertOK()
base.ComposeCmd("-f", comp.YAMLFullPath(), "ps", "svc0", "-a").AssertOutContainsAny("Created", "created")
// 1.2 created container can be started by `compose start`
base.ComposeCmd("-f", comp.YAMLFullPath(), "start").AssertOK()
testCase.Cleanup = func(data test.Data, helpers test.Helpers) {
helpers.Anyhow("compose", "-f", data.Temp().Path("compose.yaml"), "down", "-v")
}
testCase.SubTests = []*test.Case{
{
Description: "`compose create` should work",
// These are sequential
NoParallel: true,
Command: func(data test.Data, helpers test.Helpers) test.TestableCommand {
return helpers.Command("compose", "-f", data.Labels().Get("composeYaml"), "create")
},
Expected: test.Expects(expect.ExitCodeSuccess, nil, nil),
},
{
Description: "`compose create` should have created service container (in `created` status)",
NoParallel: true,
Command: func(data test.Data, helpers test.Helpers) test.TestableCommand {
return helpers.Command("compose", "-f", data.Labels().Get("composeYaml"), "ps", "svc0", "-a")
},
Expected: test.Expects(expect.ExitCodeSuccess, nil, func(stdout string, t tig.T) {
assert.Assert(t,
strings.Contains(stdout, "created") || strings.Contains(stdout, "Created"),
"stdout should contain `created`")
}),
},
{
Description: "`created container can be started by `compose start`",
NoParallel: true,
Command: func(data test.Data, helpers test.Helpers) test.TestableCommand {
return helpers.Command("compose", "-f", data.Labels().Get("composeYaml"), "start")
},
Expected: test.Expects(expect.ExitCodeSuccess, nil, nil),
},
}
testCase.Run(t)
}
func TestComposeCreateDependency(t *testing.T) {
base := testutil.NewBase(t)
var dockerComposeYAML = fmt.Sprintf(`
version: '3.1'
services:
svc0:
image: %s
@ -61,29 +95,64 @@ services:
image: %s
`, testutil.CommonImage, testutil.CommonImage)
comp := testutil.NewComposeDir(t, dockerComposeYAML)
defer comp.CleanUp()
projectName := comp.ProjectName()
t.Logf("projectName=%q", projectName)
testCase := nerdtest.Setup()
defer base.ComposeCmd("-f", comp.YAMLFullPath(), "down", "-v").AssertOK()
testCase.Setup = func(data test.Data, helpers test.Helpers) {
compYamlPath := data.Temp().Save(dockerComposeYAML, "compose.yaml")
data.Labels().Set("composeYaml", compYamlPath)
}
// `compose create` should create containers for both services and their dependencies
base.ComposeCmd("-f", comp.YAMLFullPath(), "create", "svc0").AssertOK()
base.ComposeCmd("-f", comp.YAMLFullPath(), "ps", "svc0", "-a").AssertOutContainsAny("Created", "created")
base.ComposeCmd("-f", comp.YAMLFullPath(), "ps", "svc1", "-a").AssertOutContainsAny("Created", "created")
testCase.Cleanup = func(data test.Data, helpers test.Helpers) {
helpers.Anyhow("compose", "-f", data.Temp().Path("compose.yaml"), "down", "-v")
}
testCase.SubTests = []*test.Case{
{
Description: "`compose create` should work",
// These are sequential
NoParallel: true,
Command: func(data test.Data, helpers test.Helpers) test.TestableCommand {
return helpers.Command("compose", "-f", data.Labels().Get("composeYaml"), "create")
},
Expected: test.Expects(expect.ExitCodeSuccess, nil, nil),
},
{
Description: "`compose create` should have created svc0 (in `created` status)",
NoParallel: true,
Command: func(data test.Data, helpers test.Helpers) test.TestableCommand {
return helpers.Command("compose", "-f", data.Labels().Get("composeYaml"), "ps", "svc0", "-a")
},
Expected: test.Expects(expect.ExitCodeSuccess, nil, func(stdout string, t tig.T) {
assert.Assert(t,
strings.Contains(stdout, "created") || strings.Contains(stdout, "Created"),
"stdout should contain `created`")
}),
},
{
Description: "`compose create` should have created svc1 (in `created` status)",
NoParallel: true,
Command: func(data test.Data, helpers test.Helpers) test.TestableCommand {
return helpers.Command("compose", "-f", data.Labels().Get("composeYaml"), "ps", "svc1", "-a")
},
Expected: test.Expects(expect.ExitCodeSuccess, nil, func(stdout string, t tig.T) {
assert.Assert(t,
strings.Contains(stdout, "created") || strings.Contains(stdout, "Created"),
"stdout should contain `created`")
}),
},
}
testCase.Run(t)
}
func TestComposeCreatePull(t *testing.T) {
base := testutil.NewBase(t)
var dockerComposeYAML = fmt.Sprintf(`
version: '3.1'
services:
svc0:
image: %s
`, testutil.AlpineImage)
`, testutil.CommonImage)
comp := testutil.NewComposeDir(t, dockerComposeYAML)
defer comp.CleanUp()
@ -93,12 +162,12 @@ services:
defer base.ComposeCmd("-f", comp.YAMLFullPath(), "down", "-v").AssertOK()
// `compose create --pull never` should fail: no such image
base.Cmd("rmi", "-f", testutil.AlpineImage).Run()
base.Cmd("rmi", "-f", testutil.CommonImage).Run()
base.ComposeCmd("-f", comp.YAMLFullPath(), "create", "--pull", "never").AssertFail()
// `compose create --pull missing(default)|always` should succeed: image is pulled and container is created
base.Cmd("rmi", "-f", testutil.AlpineImage).Run()
base.Cmd("rmi", "-f", testutil.CommonImage).Run()
base.ComposeCmd("-f", comp.YAMLFullPath(), "create").AssertOK()
base.Cmd("rmi", "-f", testutil.AlpineImage).Run()
base.Cmd("rmi", "-f", testutil.CommonImage).Run()
base.ComposeCmd("-f", comp.YAMLFullPath(), "create", "--pull", "always").AssertOK()
base.ComposeCmd("-f", comp.YAMLFullPath(), "ps", "svc0", "-a").AssertOutContainsAny("Created", "created")
}
@ -113,7 +182,7 @@ services:
image: %s
`, imageSvc0)
dockerfile := fmt.Sprintf(`FROM %s`, testutil.AlpineImage)
dockerfile := fmt.Sprintf(`FROM %s`, testutil.CommonImage)
testutil.RequiresBuild(t)
testutil.RegisterBuildCacheCleanup(t)

View File

@ -25,21 +25,21 @@ import (
"github.com/containerd/nerdctl/v2/pkg/composer"
)
func newComposeDownCommand() *cobra.Command {
var composeDownCommand = &cobra.Command{
func downCommand() *cobra.Command {
var cmd = &cobra.Command{
Use: "down",
Short: "Remove containers and associated resources",
Args: cobra.NoArgs,
RunE: composeDownAction,
RunE: downAction,
SilenceUsage: true,
SilenceErrors: true,
}
composeDownCommand.Flags().BoolP("volumes", "v", false, "Remove named volumes declared in the `volumes` section of the Compose file and anonymous volumes attached to containers.")
composeDownCommand.Flags().Bool("remove-orphans", false, "Remove containers for services not defined in the Compose file.")
return composeDownCommand
cmd.Flags().BoolP("volumes", "v", false, "Remove named volumes declared in the `volumes` section of the Compose file and anonymous volumes attached to containers.")
cmd.Flags().Bool("remove-orphans", false, "Remove containers for services not defined in the Compose file.")
return cmd
}
func composeDownAction(cmd *cobra.Command, args []string) error {
func downAction(cmd *cobra.Command, args []string) error {
globalOptions, err := helpers.ProcessRootCmdFlags(cmd)
if err != nil {
return err

View File

@ -30,20 +30,18 @@ func TestComposeDownRemoveUsedNetwork(t *testing.T) {
var (
dockerComposeYAMLOrphan = fmt.Sprintf(`
version: '3.1'
services:
test:
image: %s
command: "sleep infinity"
`, testutil.AlpineImage)
`, testutil.CommonImage)
dockerComposeYAMLFull = fmt.Sprintf(`
%s
orphan:
image: %s
command: "sleep infinity"
`, dockerComposeYAMLOrphan, testutil.AlpineImage)
`, dockerComposeYAMLOrphan, testutil.CommonImage)
)
compOrphan := testutil.NewComposeDir(t, dockerComposeYAMLOrphan)
@ -66,20 +64,18 @@ func TestComposeDownRemoveOrphans(t *testing.T) {
var (
dockerComposeYAMLOrphan = fmt.Sprintf(`
version: '3.1'
services:
test:
image: %s
command: "sleep infinity"
`, testutil.AlpineImage)
`, testutil.CommonImage)
dockerComposeYAMLFull = fmt.Sprintf(`
%s
orphan:
image: %s
command: "sleep infinity"
`, dockerComposeYAMLOrphan, testutil.AlpineImage)
`, dockerComposeYAMLOrphan, testutil.CommonImage)
)
compOrphan := testutil.NewComposeDir(t, dockerComposeYAMLOrphan)

View File

@ -29,39 +29,39 @@ import (
"github.com/containerd/nerdctl/v2/pkg/composer"
)
func newComposeExecCommand() *cobra.Command {
var composeExecCommand = &cobra.Command{
func execCommand() *cobra.Command {
var cmd = &cobra.Command{
Use: "exec [flags] SERVICE COMMAND [ARGS...]",
Short: "Execute a command in a running container of the service",
Args: cobra.MinimumNArgs(2),
RunE: composeExecAction,
RunE: execAction,
SilenceUsage: true,
SilenceErrors: true,
}
composeExecCommand.Flags().SetInterspersed(false)
cmd.Flags().SetInterspersed(false)
_, isTerminal := term.GetFdInfo(os.Stdout)
composeExecCommand.Flags().BoolP("no-TTY", "T", !isTerminal, "Disable pseudo-TTY allocation. By default nerdctl compose exec allocates a TTY.")
composeExecCommand.Flags().BoolP("detach", "d", false, "Detached mode: Run containers in the background")
composeExecCommand.Flags().StringP("workdir", "w", "", "Working directory inside the container")
cmd.Flags().BoolP("no-TTY", "T", !isTerminal, "Disable pseudo-TTY allocation. By default nerdctl compose exec allocates a TTY.")
cmd.Flags().BoolP("detach", "d", false, "Detached mode: Run containers in the background")
cmd.Flags().StringP("workdir", "w", "", "Working directory inside the container")
// env needs to be StringArray, not StringSlice, to prevent "FOO=foo1,foo2" from being split to {"FOO=foo1", "foo2"}
composeExecCommand.Flags().StringArrayP("env", "e", nil, "Set environment variables")
composeExecCommand.Flags().Bool("privileged", false, "Give extended privileges to the command")
composeExecCommand.Flags().StringP("user", "u", "", "Username or UID (format: <name|uid>[:<group|gid>])")
composeExecCommand.Flags().Int("index", 1, "index of the container if the service has multiple instances.")
cmd.Flags().StringArrayP("env", "e", nil, "Set environment variables")
cmd.Flags().Bool("privileged", false, "Give extended privileges to the command")
cmd.Flags().StringP("user", "u", "", "Username or UID (format: <name|uid>[:<group|gid>])")
cmd.Flags().Int("index", 1, "index of the container if the service has multiple instances.")
composeExecCommand.Flags().BoolP("interactive", "i", true, "Keep STDIN open even if not attached")
composeExecCommand.Flags().MarkHidden("interactive")
cmd.Flags().BoolP("interactive", "i", true, "Keep STDIN open even if not attached")
cmd.Flags().MarkHidden("interactive")
// The -t does not has effect to keep the compatibility with docker.
// The proposal of -t is to keep "muscle memory" with compose v1: https://github.com/docker/compose/issues/9207
// FYI: https://github.com/docker/compose/blob/v2.23.1/cmd/compose/exec.go#L77
composeExecCommand.Flags().BoolP("tty", "t", true, "Allocate a pseudo-TTY")
composeExecCommand.Flags().MarkHidden("tty")
cmd.Flags().BoolP("tty", "t", true, "Allocate a pseudo-TTY")
cmd.Flags().MarkHidden("tty")
return composeExecCommand
return cmd
}
func composeExecAction(cmd *cobra.Command, args []string) error {
func execAction(cmd *cobra.Command, args []string) error {
globalOptions, err := helpers.ProcessRootCmdFlags(cmd)
if err != nil {
return err

View File

@ -17,22 +17,23 @@
package compose
import (
"errors"
"fmt"
"net"
"path/filepath"
"strings"
"testing"
"gotest.tools/v3/assert"
"github.com/containerd/nerdctl/mod/tigron/expect"
"github.com/containerd/nerdctl/mod/tigron/test"
"github.com/containerd/nerdctl/v2/pkg/testutil"
"github.com/containerd/nerdctl/v2/pkg/testutil/nerdtest"
)
func TestComposeExec(t *testing.T) {
base := testutil.NewBase(t)
var dockerComposeYAML = fmt.Sprintf(`
version: '3.1'
dockerComposeYAML := fmt.Sprintf(`
services:
svc0:
image: %s
@ -42,107 +43,109 @@ services:
command: "sleep infinity"
`, testutil.CommonImage, testutil.CommonImage)
comp := testutil.NewComposeDir(t, dockerComposeYAML)
defer comp.CleanUp()
projectName := comp.ProjectName()
t.Logf("projectName=%q", projectName)
testCase := nerdtest.Setup()
base.ComposeCmd("-f", comp.YAMLFullPath(), "up", "-d", "svc0").AssertOK()
defer base.ComposeCmd("-f", comp.YAMLFullPath(), "down", "-v").AssertOK()
testCase.Setup = func(data test.Data, helpers test.Helpers) {
yamlPath := data.Temp().Save(dockerComposeYAML, "compose.yaml")
data.Labels().Set("YAMLPath", yamlPath)
helpers.Ensure("compose", "-f", yamlPath, "up", "-d", "svc0")
}
// test basic functionality and `--workdir` flag
base.ComposeCmd("-f", comp.YAMLFullPath(), "exec", "-i=false", "--no-TTY", "svc0", "echo", "success").AssertOutExactly("success\n")
base.ComposeCmd("-f", comp.YAMLFullPath(), "exec", "-i=false", "--no-TTY", "--workdir", "/tmp", "svc0", "pwd").AssertOutExactly("/tmp\n")
// cannot `exec` on non-running service
base.ComposeCmd("-f", comp.YAMLFullPath(), "exec", "svc1", "echo", "success").AssertFail()
}
testCase.Cleanup = func(data test.Data, helpers test.Helpers) {
helpers.Anyhow("compose", "-f", data.Temp().Path("compose.yaml"), "down", "-v")
}
func TestComposeExecWithEnv(t *testing.T) {
base := testutil.NewBase(t)
var dockerComposeYAML = fmt.Sprintf(`
version: '3.1'
testCase.SubTests = []*test.Case{
{
Description: "exec no tty",
Command: func(data test.Data, helpers test.Helpers) test.TestableCommand {
return helpers.Command(
"compose",
"-f",
data.Labels().Get("YAMLPath"),
"exec",
"-i=false",
"--no-TTY",
"svc0",
"echo",
"success",
)
},
Expected: test.Expects(expect.ExitCodeSuccess, nil, expect.Equals("success\n")),
},
{
Description: "exec no tty with workdir",
Command: func(data test.Data, helpers test.Helpers) test.TestableCommand {
return helpers.Command(
"compose",
"-f",
data.Labels().Get("YAMLPath"),
"exec",
"-i=false",
"--no-TTY",
"--workdir",
"/tmp",
"svc0",
"pwd",
)
},
Expected: test.Expects(expect.ExitCodeSuccess, nil, expect.Equals("/tmp\n")),
},
{
Description: "cannot exec on non-running service",
Command: func(data test.Data, helpers test.Helpers) test.TestableCommand {
return helpers.Command("compose", "-f", data.Labels().Get("YAMLPath"), "exec", "svc1", "echo", "success")
},
Expected: test.Expects(expect.ExitCodeGenericFail, nil, nil),
},
{
Description: "with env",
Env: map[string]string{
"CORGE": "corge-value-in-host",
"GARPLY": "garply-value-in-host",
},
Command: func(data test.Data, helpers test.Helpers) test.TestableCommand {
return helpers.Command(
"compose",
"-f",
data.Labels().Get("YAMLPath"),
"exec",
"-i=false",
"--no-TTY",
"--env", "FOO=foo1,foo2",
"--env", "BAR=bar1 bar2",
"--env", "BAZ=",
"--env", "QUX", // not exported in OS
"--env", "QUUX=quux1",
"--env", "QUUX=quux2",
"--env", "CORGE", // OS exported
"--env", "GRAULT=grault_key=grault_value", // value contains `=` char
"--env", "GARPLY=", // OS exported
"--env", "WALDO=", // not exported in OS
"svc0",
"env")
},
Expected: test.Expects(expect.ExitCodeSuccess, nil, expect.All(
expect.Contains(
"\nFOO=foo1,foo2\n",
"\nBAR=bar1 bar2\n",
"\nBAZ=\n",
"\nQUUX=quux2\n",
"\nCORGE=corge-value-in-host\n",
"\nGRAULT=grault_key=grault_value\n",
"\nGARPLY=\n",
"\nWALDO=\n"),
expect.DoesNotContain("QUX"),
)),
},
}
services:
svc0:
image: %s
command: "sleep infinity"
`, testutil.CommonImage)
userSubTest := &test.Case{
Description: "with user",
SubTests: []*test.Case{},
}
comp := testutil.NewComposeDir(t, dockerComposeYAML)
defer comp.CleanUp()
projectName := comp.ProjectName()
t.Logf("projectName=%q", projectName)
base.ComposeCmd("-f", comp.YAMLFullPath(), "up", "-d").AssertOK()
defer base.ComposeCmd("-f", comp.YAMLFullPath(), "down", "-v").AssertOK()
// FYI: https://github.com/containerd/nerdctl/blob/e4b2b6da56555dc29ed66d0fd8e7094ff2bc002d/cmd/nerdctl/run_test.go#L177
base.Env = append(base.Env, "CORGE=corge-value-in-host", "GARPLY=garply-value-in-host")
base.ComposeCmd("-f", comp.YAMLFullPath(), "exec", "-i=false", "--no-TTY",
"--env", "FOO=foo1,foo2",
"--env", "BAR=bar1 bar2",
"--env", "BAZ=",
"--env", "QUX", // not exported in OS
"--env", "QUUX=quux1",
"--env", "QUUX=quux2",
"--env", "CORGE", // OS exported
"--env", "GRAULT=grault_key=grault_value", // value contains `=` char
"--env", "GARPLY=", // OS exported
"--env", "WALDO=", // not exported in OS
"svc0", "env").AssertOutWithFunc(func(stdout string) error {
if !strings.Contains(stdout, "\nFOO=foo1,foo2\n") {
return errors.New("got bad FOO")
}
if !strings.Contains(stdout, "\nBAR=bar1 bar2\n") {
return errors.New("got bad BAR")
}
if !strings.Contains(stdout, "\nBAZ=\n") {
return errors.New("got bad BAZ")
}
if strings.Contains(stdout, "QUX") {
return errors.New("got bad QUX (should not be set)")
}
if !strings.Contains(stdout, "\nQUUX=quux2\n") {
return errors.New("got bad QUUX")
}
if !strings.Contains(stdout, "\nCORGE=corge-value-in-host\n") {
return errors.New("got bad CORGE")
}
if !strings.Contains(stdout, "\nGRAULT=grault_key=grault_value\n") {
return errors.New("got bad GRAULT")
}
if !strings.Contains(stdout, "\nGARPLY=\n") {
return errors.New("got bad GARPLY")
}
if !strings.Contains(stdout, "\nWALDO=\n") {
return errors.New("got bad WALDO")
}
return nil
})
}
func TestComposeExecWithUser(t *testing.T) {
base := testutil.NewBase(t)
var dockerComposeYAML = fmt.Sprintf(`
version: '3.1'
services:
svc0:
image: %s
command: "sleep infinity"
`, testutil.CommonImage)
comp := testutil.NewComposeDir(t, dockerComposeYAML)
defer comp.CleanUp()
projectName := comp.ProjectName()
t.Logf("projectName=%q", projectName)
base.ComposeCmd("-f", comp.YAMLFullPath(), "up", "-d").AssertOK()
defer base.ComposeCmd("-f", comp.YAMLFullPath(), "down", "-v").AssertOK()
testCases := map[string]string{
userCasesMap := map[string]string{
"": "uid=0(root) gid=0(root)",
"1000": "uid=1000 gid=0(root)",
"1000:users": "uid=1000 gid=100(users)",
@ -151,26 +154,29 @@ services:
"nobody:users": "uid=65534(nobody) gid=100(users)",
}
for userStr, expected := range testCases {
args := []string{"-f", comp.YAMLFullPath(), "exec", "-i=false", "--no-TTY"}
if userStr != "" {
args = append(args, "--user", userStr)
}
args = append(args, "svc0", "id")
base.ComposeCmd(args...).AssertOutContains(expected)
for k, v := range userCasesMap {
userSubTest.SubTests = append(userSubTest.SubTests, &test.Case{
Description: k + " " + v,
Command: func(data test.Data, helpers test.Helpers) test.TestableCommand {
args := []string{"compose", "-f", data.Labels().Get("YAMLPath"), "exec", "-i=false", "--no-TTY"}
if k != "" {
args = append(args, "--user", k)
}
args = append(args, "svc0", "id")
return helpers.Command(args...)
},
Expected: test.Expects(expect.ExitCodeSuccess, nil, expect.Contains(v)),
})
}
testCase.SubTests = append(testCase.SubTests, userSubTest)
testCase.Run(t)
}
func TestComposeExecTTY(t *testing.T) {
// `-i` in `compose run & exec` is only supported in compose v2.
base := testutil.NewBase(t)
if testutil.GetTarget() == testutil.Nerdctl {
testutil.RequireDaemonVersion(base, ">= 1.6.0-0")
}
var dockerComposeYAML = fmt.Sprintf(`
version: '3.1'
const expectedOutput = "speed 38400 baud"
dockerComposeYAML := fmt.Sprintf(`
services:
svc0:
image: %s
@ -178,31 +184,85 @@ services:
image: %s
`, testutil.CommonImage, testutil.CommonImage)
comp := testutil.NewComposeDir(t, dockerComposeYAML)
defer comp.CleanUp()
projectName := comp.ProjectName()
t.Logf("projectName=%q", projectName)
testCase := nerdtest.Setup()
testContainer := testutil.Identifier(t)
base.ComposeCmd("-f", comp.YAMLFullPath(), "run", "-d", "-i=false", "--name", testContainer, "svc0", "sleep", "1h").AssertOK()
defer base.ComposeCmd("-f", comp.YAMLFullPath(), "down", "-v").AssertOK()
base.EnsureContainerStarted(testContainer)
testCase.Setup = func(data test.Data, helpers test.Helpers) {
yamlPath := data.Temp().Save(dockerComposeYAML, "compose.yaml")
data.Labels().Set("YAMLPath", yamlPath)
helpers.Ensure(
"compose",
"-f",
yamlPath,
"run",
"-d",
"-i=false",
"--name",
data.Identifier(),
"svc0",
"sleep",
"1h",
)
}
const sttyPartialOutput = "speed 38400 baud"
// unbuffer(1) emulates tty, which is required by `nerdctl run -t`.
// unbuffer(1) can be installed with `apt-get install expect`.
unbuffer := []string{"unbuffer"}
base.ComposeCmdWithHelper(unbuffer, "-f", comp.YAMLFullPath(), "exec", "svc0", "stty").AssertOutContains(sttyPartialOutput) // `-it`
base.ComposeCmdWithHelper(unbuffer, "-f", comp.YAMLFullPath(), "exec", "-i=false", "svc0", "stty").AssertOutContains(sttyPartialOutput) // `-t`
base.ComposeCmdWithHelper(unbuffer, "-f", comp.YAMLFullPath(), "exec", "--no-TTY", "svc0", "stty").AssertFail() // `-i`
base.ComposeCmdWithHelper(unbuffer, "-f", comp.YAMLFullPath(), "exec", "-i=false", "--no-TTY", "svc0", "stty").AssertFail()
testCase.Cleanup = func(data test.Data, helpers test.Helpers) {
// FIXME?
// similar, other test does *also* remove the container
helpers.Anyhow("compose", "-f", data.Labels().Get("YAMLPath"), "down", "-v")
}
testCase.SubTests = []*test.Case{
{
Description: "stty exec",
Command: func(data test.Data, helpers test.Helpers) test.TestableCommand {
cmd := helpers.Command("compose", "-f", data.Labels().Get("YAMLPath"), "exec", "svc0", "stty")
cmd.WithPseudoTTY()
return cmd
},
Expected: test.Expects(expect.ExitCodeSuccess, nil, expect.Contains(expectedOutput)),
},
{
Description: "-i=false stty exec",
Command: func(data test.Data, helpers test.Helpers) test.TestableCommand {
cmd := helpers.Command("compose", "-f", data.Labels().Get("YAMLPath"), "exec", "-i=false", "svc0", "stty")
cmd.WithPseudoTTY()
return cmd
},
Expected: test.Expects(expect.ExitCodeSuccess, nil, expect.Contains(expectedOutput)),
},
{
Description: "--no-TTY stty exec",
Command: func(data test.Data, helpers test.Helpers) test.TestableCommand {
cmd := helpers.Command("compose", "-f", data.Labels().Get("YAMLPath"), "exec", "--no-TTY", "svc0", "stty")
cmd.WithPseudoTTY()
return cmd
},
Expected: test.Expects(expect.ExitCodeGenericFail, nil, nil),
},
{
Description: "-i=false --no-TTY stty exec",
Command: func(data test.Data, helpers test.Helpers) test.TestableCommand {
cmd := helpers.Command(
"compose",
"-f",
data.Labels().Get("YAMLPath"),
"exec",
"-i=false",
"--no-TTY",
"svc0",
"stty",
)
cmd.WithPseudoTTY()
return cmd
},
Expected: test.Expects(expect.ExitCodeGenericFail, nil, nil),
},
}
testCase.Run(t)
}
func TestComposeExecWithIndex(t *testing.T) {
base := testutil.NewBase(t)
var dockerComposeYAML = fmt.Sprintf(`
version: '3.1'
dockerComposeYAML := fmt.Sprintf(`
services:
svc0:
image: %s
@ -211,39 +271,57 @@ services:
replicas: 3
`, testutil.CommonImage)
comp := testutil.NewComposeDir(t, dockerComposeYAML)
t.Cleanup(func() {
comp.CleanUp()
})
projectName := comp.ProjectName()
t.Logf("projectName=%q", projectName)
testCase := nerdtest.Setup()
base.ComposeCmd("-f", comp.YAMLFullPath(), "up", "-d", "svc0").AssertOK()
t.Cleanup(func() {
base.ComposeCmd("-f", comp.YAMLFullPath(), "down", "-v").AssertOK()
})
testCase.Setup = func(data test.Data, helpers test.Helpers) {
yamlPath := data.Temp().Save(dockerComposeYAML, "compose.yaml")
data.Labels().Set("YAMLPath", yamlPath)
data.Labels().Set("projectName", strings.ToLower(filepath.Base(data.Temp().Dir())))
// try 5 times to ensure that results are stable
for i := 0; i < 5; i++ {
for _, j := range []string{"1", "2", "3"} {
name := fmt.Sprintf("%s-svc0-%s", projectName, j)
host := fmt.Sprintf("%s.%s_default", name, projectName)
var (
expectIP string
realIP string
)
// docker and nerdctl have different DNS resolution behaviors.
// it uses the ID in the /etc/hosts file, so we need to fetch the ID first.
if testutil.GetTarget() == testutil.Docker {
base.Cmd("ps", "--filter", fmt.Sprintf("name=%s", name), "--format", "{{.ID}}").AssertOutWithFunc(func(stdout string) error {
host = strings.TrimSpace(stdout)
return nil
})
}
cmds := []string{"-f", comp.YAMLFullPath(), "exec", "-i=false", "--no-TTY", "--index", j, "svc0"}
base.ComposeCmd(append(cmds, "cat", "/etc/hosts")...).
AssertOutWithFunc(func(stdout string) error {
lines := strings.Split(stdout, "\n")
helpers.Ensure("compose", "-f", yamlPath, "up", "-d", "svc0")
// Make sure all containers are started so that /etc/hosts is consistent.
for _, index := range []string{"1", "2", "3"} {
nerdtest.EnsureContainerStarted(helpers, fmt.Sprintf("%s-svc0-%s", data.Labels().Get("projectName"), index))
}
}
testCase.Cleanup = func(data test.Data, helpers test.Helpers) {
helpers.Anyhow("compose", "-f", data.Temp().Path("compose.yaml"), "down", "-v")
}
for _, index := range []string{"1", "2", "3"} {
testCase.SubTests = append(testCase.SubTests, &test.Case{
Description: index,
Setup: func(data test.Data, helpers test.Helpers) {
// try 5 times to ensure that results are stable
for range 5 {
cmds := []string{
"compose",
"-f",
data.Labels().Get("YAMLPath"),
"exec",
"-i=false",
"--no-TTY",
"--index",
index,
"svc0",
}
hsts := helpers.Capture(append(cmds, "cat", "/etc/hosts")...)
ips := helpers.Capture(append(cmds, "ip", "addr", "show", "dev", "eth0")...)
var (
expectIP string
realIP string
)
name := fmt.Sprintf("%s-svc0-%s", data.Labels().Get("projectName"), index)
host := fmt.Sprintf("%s.%s_default", name, data.Labels().Get("projectName"))
if nerdtest.IsDocker() {
host = strings.TrimSpace(helpers.Capture("ps", "--filter", "name="+name, "--format", "{{.ID}}"))
}
lines := strings.Split(hsts, "\n")
for _, line := range lines {
if !strings.Contains(line, host) {
continue
@ -253,37 +331,32 @@ services:
continue
}
expectIP = fields[0]
return nil
}
return errors.New("fail to get the expected ip address")
})
base.ComposeCmd(append(cmds, "ip", "addr", "show", "dev", "eth0")...).
AssertOutWithFunc(func(stdout string) error {
ip := findIP(stdout)
if ip == nil {
return errors.New("fail to get the real ip address")
}
realIP = ip.String()
return nil
})
assert.Equal(t, realIP, expectIP)
}
}
}
func findIP(output string) net.IP {
var ip string
lines := strings.Split(output, "\n")
for _, line := range lines {
if !strings.Contains(line, "inet ") {
continue
}
fields := strings.Fields(line)
if len(fields) <= 1 {
continue
}
ip = strings.Split(fields[1], "/")[0]
break
var ip string
lines = strings.Split(ips, "\n")
for _, line := range lines {
if !strings.Contains(line, "inet ") {
continue
}
fields := strings.Fields(line)
if len(fields) <= 1 {
continue
}
ip = strings.Split(fields[1], "/")[0]
break
}
pip := net.ParseIP(ip)
assert.Assert(helpers.T(), pip != nil, "fail to get the real ip address")
realIP = pip.String()
assert.Equal(helpers.T(), realIP, expectIP)
}
},
})
}
return net.ParseIP(ip)
testCase.Run(t)
}

View File

@ -38,20 +38,20 @@ import (
"github.com/containerd/nerdctl/v2/pkg/strutil"
)
func newComposeImagesCommand() *cobra.Command {
var composeImagesCommand = &cobra.Command{
func imagesCommand() *cobra.Command {
var cmd = &cobra.Command{
Use: "images [flags] [SERVICE...]",
Short: "List images used by created containers in services",
RunE: composeImagesAction,
RunE: imagesAction,
SilenceUsage: true,
SilenceErrors: true,
}
composeImagesCommand.Flags().String("format", "", "Format the output. Supported values: [json]")
composeImagesCommand.Flags().BoolP("quiet", "q", false, "Only show numeric image IDs")
return composeImagesCommand
cmd.Flags().String("format", "", "Format the output. Supported values: [json]")
cmd.Flags().BoolP("quiet", "q", false, "Only show numeric image IDs")
return cmd
}
func composeImagesAction(cmd *cobra.Command, args []string) error {
func imagesAction(cmd *cobra.Command, args []string) error {
globalOptions, err := helpers.ProcessRootCmdFlags(cmd)
if err != nil {
return err

View File

@ -17,77 +17,26 @@
package compose
import (
"encoding/json"
"fmt"
"strings"
"testing"
"gotest.tools/v3/assert"
"github.com/containerd/nerdctl/mod/tigron/expect"
"github.com/containerd/nerdctl/mod/tigron/test"
"github.com/containerd/nerdctl/mod/tigron/tig"
"github.com/containerd/nerdctl/v2/pkg/referenceutil"
"github.com/containerd/nerdctl/v2/pkg/testutil"
"github.com/containerd/nerdctl/v2/pkg/testutil/nerdtest"
)
func TestComposeImages(t *testing.T) {
base := testutil.NewBase(t)
var dockerComposeYAML = fmt.Sprintf(`
version: '3.1'
services:
wordpress:
image: %s
ports:
- 8080:80
environment:
WORDPRESS_DB_HOST: db
WORDPRESS_DB_USER: exampleuser
WORDPRESS_DB_PASSWORD: examplepass
WORDPRESS_DB_NAME: exampledb
volumes:
- wordpress:/var/www/html
db:
image: %s
environment:
MYSQL_DATABASE: exampledb
MYSQL_USER: exampleuser
MYSQL_PASSWORD: examplepass
MYSQL_RANDOM_ROOT_PASSWORD: '1'
volumes:
- db:/var/lib/mysql
volumes:
wordpress:
db:
`, testutil.WordpressImage, testutil.MariaDBImage)
comp := testutil.NewComposeDir(t, dockerComposeYAML)
defer comp.CleanUp()
projectName := comp.ProjectName()
t.Logf("projectName=%q", projectName)
base.ComposeCmd("-f", comp.YAMLFullPath(), "up", "-d").AssertOK()
defer base.ComposeCmd("-f", comp.YAMLFullPath(), "down", "-v").Run()
wordpressImageName := strings.Split(testutil.WordpressImage, ":")[0]
dbImageName := strings.Split(testutil.MariaDBImage, ":")[0]
// check one service image
base.ComposeCmd("-f", comp.YAMLFullPath(), "images", "db").AssertOutContains(dbImageName)
base.ComposeCmd("-f", comp.YAMLFullPath(), "images", "db").AssertOutNotContains(wordpressImageName)
// check all service images
base.ComposeCmd("-f", comp.YAMLFullPath(), "images").AssertOutContains(dbImageName)
base.ComposeCmd("-f", comp.YAMLFullPath(), "images").AssertOutContains(wordpressImageName)
}
func TestComposeImagesJson(t *testing.T) {
base := testutil.NewBase(t)
var dockerComposeYAML = fmt.Sprintf(`
version: '3.1'
services:
wordpress:
image: %s
container_name: wordpress
ports:
- 8080:80
environment:
WORDPRESS_DB_HOST: db
WORDPRESS_DB_USER: exampleuser
@ -111,41 +60,71 @@ volumes:
db:
`, testutil.WordpressImage, testutil.MariaDBImage)
comp := testutil.NewComposeDir(t, dockerComposeYAML)
defer comp.CleanUp()
projectName := comp.ProjectName()
t.Logf("projectName=%q", projectName)
wordpressImageName, _ := referenceutil.Parse(testutil.WordpressImage)
dbImageName, _ := referenceutil.Parse(testutil.MariaDBImage)
base.ComposeCmd("-f", comp.YAMLFullPath(), "up", "-d").AssertOK()
defer base.ComposeCmd("-f", comp.YAMLFullPath(), "down", "-v").Run()
testCase := nerdtest.Setup()
assertHandler := func(svc string, count int, fields ...string) func(stdout string) error {
return func(stdout string) error {
// 1. check json output can be unmarshalled back to printables.
var printables []composeContainerPrintable
if err := json.Unmarshal([]byte(stdout), &printables); err != nil {
return fmt.Errorf("[service: %s]failed to unmarshal json output from `compose images`: %s", svc, stdout)
}
// 2. check #printables matches expected count.
if len(printables) != count {
return fmt.Errorf("[service: %s]unmarshal generates %d printables, expected %d: %s", svc, len(printables), count, stdout)
}
// 3. check marshalled json string has all expected substrings.
for _, field := range fields {
if !strings.Contains(stdout, field) {
return fmt.Errorf("[service: %s]marshalled json output doesn't have expected string (%s): %s", svc, field, stdout)
}
}
return nil
}
testCase.Setup = func(data test.Data, helpers test.Helpers) {
data.Temp().Save(dockerComposeYAML, "compose.yaml")
data.Labels().Set("composeYaml", data.Temp().Path("compose.yaml"))
helpers.Ensure("compose", "-f", data.Temp().Path("compose.yaml"), "up", "-d")
}
// check other formats are not supported
base.ComposeCmd("-f", comp.YAMLFullPath(), "images", "--format", "yaml").AssertFail()
// check all services are up (can be marshalled and unmarshalled)
base.ComposeCmd("-f", comp.YAMLFullPath(), "images", "--format", "json").
AssertOutWithFunc(assertHandler("all", 2, `"ContainerName":"wordpress"`, `"ContainerName":"db"`))
testCase.Cleanup = func(data test.Data, helpers test.Helpers) {
helpers.Anyhow("compose", "-f", data.Temp().Path("compose.yaml"), "down")
}
base.ComposeCmd("-f", comp.YAMLFullPath(), "images", "--format", "json", "wordpress").
AssertOutWithFunc(assertHandler("wordpress", 1, `"ContainerName":"wordpress"`))
testCase.SubTests = []*test.Case{
{
Description: "images db",
Command: func(data test.Data, helpers test.Helpers) test.TestableCommand {
return helpers.Command("compose", "-f", data.Labels().Get("composeYaml"), "images", "db")
},
Expected: test.Expects(expect.ExitCodeSuccess, nil, expect.All(
expect.Contains(dbImageName.Name()),
expect.DoesNotContain(wordpressImageName.Name()),
)),
},
{
Description: "images",
Command: func(data test.Data, helpers test.Helpers) test.TestableCommand {
return helpers.Command("compose", "-f", data.Labels().Get("composeYaml"), "images")
},
Expected: test.Expects(expect.ExitCodeSuccess, nil, expect.Contains(dbImageName.Name(), wordpressImageName.Name())),
},
{
Description: "images --format yaml",
Command: func(data test.Data, helpers test.Helpers) test.TestableCommand {
return helpers.Command("compose", "-f", data.Labels().Get("composeYaml"), "images", "--format", "yaml")
},
Expected: test.Expects(expect.ExitCodeGenericFail, nil, nil),
},
{
Description: "images --format json",
Command: func(data test.Data, helpers test.Helpers) test.TestableCommand {
return helpers.Command("compose", "-f", data.Labels().Get("composeYaml"), "images", "--format", "json")
},
Expected: test.Expects(expect.ExitCodeSuccess, nil, expect.All(
expect.JSON([]composeContainerPrintable{}, func(printables []composeContainerPrintable, t tig.T) {
assert.Equal(t, len(printables), 2)
}),
expect.Contains(`"ContainerName":"wordpress"`, `"ContainerName":"db"`),
)),
},
{
Description: "images --format json wordpress",
Command: func(data test.Data, helpers test.Helpers) test.TestableCommand {
return helpers.Command("compose", "-f", data.Labels().Get("composeYaml"), "images", "--format", "json", "wordpress")
},
Expected: test.Expects(expect.ExitCodeSuccess, nil, expect.All(
expect.JSON([]composeContainerPrintable{}, func(printables []composeContainerPrintable, t tig.T) {
assert.Equal(t, len(printables), 1)
}),
expect.Contains(`"ContainerName":"wordpress"`),
)),
},
}
testCase.Run(t)
}

View File

@ -25,19 +25,19 @@ import (
"github.com/containerd/nerdctl/v2/pkg/composer"
)
func newComposeKillCommand() *cobra.Command {
var composeKillCommand = &cobra.Command{
func killCommand() *cobra.Command {
var cmd = &cobra.Command{
Use: "kill [flags] [SERVICE...]",
Short: "Force stop service containers",
RunE: composeKillAction,
RunE: killAction,
SilenceUsage: true,
SilenceErrors: true,
}
composeKillCommand.Flags().StringP("signal", "s", "SIGKILL", "SIGNAL to send to the container.")
return composeKillCommand
cmd.Flags().StringP("signal", "s", "SIGKILL", "SIGNAL to send to the container.")
return cmd
}
func composeKillAction(cmd *cobra.Command, args []string) error {
func killAction(cmd *cobra.Command, args []string) error {
globalOptions, err := helpers.ProcessRootCmdFlags(cmd)
if err != nil {
return err

View File

@ -27,14 +27,10 @@ import (
func TestComposeKill(t *testing.T) {
base := testutil.NewBase(t)
var dockerComposeYAML = fmt.Sprintf(`
version: '3.1'
services:
wordpress:
image: %s
ports:
- 8080:80
environment:
WORDPRESS_DB_HOST: db
WORDPRESS_DB_USER: exampleuser

View File

@ -25,23 +25,23 @@ import (
"github.com/containerd/nerdctl/v2/pkg/composer"
)
func newComposeLogsCommand() *cobra.Command {
var composeLogsCommand = &cobra.Command{
func logsCommand() *cobra.Command {
var cmd = &cobra.Command{
Use: "logs [flags] [SERVICE...]",
Short: "Show logs of running containers",
RunE: composeLogsAction,
RunE: logsAction,
SilenceUsage: true,
SilenceErrors: true,
}
composeLogsCommand.Flags().BoolP("follow", "f", false, "Follow log output.")
composeLogsCommand.Flags().BoolP("timestamps", "t", false, "Show timestamps")
composeLogsCommand.Flags().String("tail", "all", "Number of lines to show from the end of the logs")
composeLogsCommand.Flags().Bool("no-color", false, "Produce monochrome output")
composeLogsCommand.Flags().Bool("no-log-prefix", false, "Don't print prefix in logs")
return composeLogsCommand
cmd.Flags().BoolP("follow", "f", false, "Follow log output.")
cmd.Flags().BoolP("timestamps", "t", false, "Show timestamps")
cmd.Flags().String("tail", "all", "Number of lines to show from the end of the logs")
cmd.Flags().Bool("no-color", false, "Produce monochrome output")
cmd.Flags().Bool("no-log-prefix", false, "Don't print prefix in logs")
return cmd
}
func composeLogsAction(cmd *cobra.Command, args []string) error {
func logsAction(cmd *cobra.Command, args []string) error {
globalOptions, err := helpers.ProcessRootCmdFlags(cmd)
if err != nil {
return err

View File

@ -24,19 +24,19 @@ import (
"github.com/containerd/nerdctl/v2/pkg/cmd/compose"
)
func newComposePauseCommand() *cobra.Command {
var composePauseCommand = &cobra.Command{
func pauseCommand() *cobra.Command {
var cmd = &cobra.Command{
Use: "pause [SERVICE...]",
Short: "Pause all processes within containers of service(s). They can be unpaused with nerdctl compose unpause",
RunE: composePauseAction,
RunE: pauseAction,
SilenceUsage: true,
SilenceErrors: true,
DisableFlagsInUseLine: true,
}
return composePauseCommand
return cmd
}
func composePauseAction(cmd *cobra.Command, args []string) error {
func pauseAction(cmd *cobra.Command, args []string) error {
globalOptions, err := helpers.ProcessRootCmdFlags(cmd)
if err != nil {
return err
@ -59,19 +59,19 @@ func composePauseAction(cmd *cobra.Command, args []string) error {
return c.Pause(ctx, args, cmd.OutOrStdout())
}
func newComposeUnpauseCommand() *cobra.Command {
var composeUnpauseCommand = &cobra.Command{
func unpauseCommand() *cobra.Command {
var cmd = &cobra.Command{
Use: "unpause [SERVICE...]",
Short: "Unpause all processes within containers of service(s).",
RunE: composeUnpauseAction,
RunE: unpauseAction,
SilenceUsage: true,
SilenceErrors: true,
DisableFlagsInUseLine: true,
}
return composeUnpauseCommand
return cmd
}
func composeUnpauseAction(cmd *cobra.Command, args []string) error {
func unpauseAction(cmd *cobra.Command, args []string) error {
globalOptions, err := helpers.ProcessRootCmdFlags(cmd)
if err != nil {
return err

View File

@ -31,8 +31,6 @@ func TestComposePauseAndUnpause(t *testing.T) {
}
var dockerComposeYAML = fmt.Sprintf(`
version: '3.1'
services:
svc0:
image: %s

View File

@ -28,22 +28,22 @@ import (
"github.com/containerd/nerdctl/v2/pkg/composer"
)
func newComposePortCommand() *cobra.Command {
var composePortCommand = &cobra.Command{
func portCommand() *cobra.Command {
var cmd = &cobra.Command{
Use: "port [flags] SERVICE PRIVATE_PORT",
Short: "Print the public port for a port binding",
Args: cobra.ExactArgs(2),
RunE: composePortAction,
RunE: portAction,
SilenceUsage: true,
SilenceErrors: true,
}
composePortCommand.Flags().Int("index", 1, "index of the container if the service has multiple instances.")
composePortCommand.Flags().String("protocol", "tcp", "protocol of the port (tcp|udp)")
cmd.Flags().Int("index", 1, "index of the container if the service has multiple instances.")
cmd.Flags().String("protocol", "tcp", "protocol of the port (tcp|udp)")
return composePortCommand
return cmd
}
func composePortAction(cmd *cobra.Command, args []string) error {
func portAction(cmd *cobra.Command, args []string) error {
globalOptions, err := helpers.ProcessRootCmdFlags(cmd)
if err != nil {
return err
@ -88,11 +88,18 @@ func composePortAction(cmd *cobra.Command, args []string) error {
return err
}
dataStore, err := clientutil.DataStore(globalOptions.DataRoot, globalOptions.Address)
if err != nil {
return err
}
po := composer.PortOptions{
ServiceName: args[0],
Index: index,
Port: port,
Protocol: protocol,
DataStore: dataStore,
Namespace: globalOptions.Namespace,
}
return c.Port(ctx, cmd.OutOrStdout(), po)

View File

@ -20,15 +20,17 @@ import (
"fmt"
"testing"
"github.com/containerd/nerdctl/mod/tigron/expect"
"github.com/containerd/nerdctl/mod/tigron/test"
"github.com/containerd/nerdctl/v2/pkg/testutil"
"github.com/containerd/nerdctl/v2/pkg/testutil/nerdtest"
)
func TestComposePort(t *testing.T) {
base := testutil.NewBase(t)
var dockerComposeYAML = fmt.Sprintf(`
version: '3.1'
services:
svc0:
image: %s
@ -55,8 +57,6 @@ func TestComposePortFailure(t *testing.T) {
base := testutil.NewBase(t)
var dockerComposeYAML = fmt.Sprintf(`
version: '3.1'
services:
svc0:
image: %s
@ -79,3 +79,42 @@ services:
base.ComposeCmd("-f", comp.YAMLFullPath(), "port", "--protocol", "udp", "svc0", "10000").AssertFail()
base.ComposeCmd("-f", comp.YAMLFullPath(), "port", "--protocol", "tcp", "svc0", "10001").AssertFail()
}
// TestComposeMultiplePorts tests whether it is possible to allocate a large
// number of ports. (https://github.com/containerd/nerdctl/issues/4027)
func TestComposeMultiplePorts(t *testing.T) {
var dockerComposeYAML = fmt.Sprintf(`
services:
svc0:
image: %s
command: "sleep infinity"
ports:
- '32000-32060:32000-32060'
`, testutil.AlpineImage)
testCase := nerdtest.Setup()
testCase.Setup = func(data test.Data, helpers test.Helpers) {
compYamlPath := data.Temp().Save(dockerComposeYAML, "compose.yaml")
data.Labels().Set("composeYaml", compYamlPath)
helpers.Ensure("compose", "-f", compYamlPath, "up", "-d")
}
testCase.Cleanup = func(data test.Data, helpers test.Helpers) {
helpers.Anyhow("compose", "-f", data.Temp().Path("compose.yaml"), "down", "-v")
}
testCase.SubTests = []*test.Case{
{
Description: "Issue #4027 - Allocate a large number of ports.",
NoParallel: true,
Command: func(data test.Data, helpers test.Helpers) test.TestableCommand {
return helpers.Command("compose", "-f", data.Labels().Get("composeYaml"), "port", "svc0", "32000")
},
Expected: test.Expects(expect.ExitCodeSuccess, nil, expect.Contains("0.0.0.0:32000")),
},
}
testCase.Run(t)
}

View File

@ -21,7 +21,6 @@ import (
"fmt"
"strings"
"text/tabwriter"
"time"
"github.com/spf13/cobra"
"golang.org/x/sync/errgroup"
@ -29,10 +28,10 @@ import (
containerd "github.com/containerd/containerd/v2/client"
"github.com/containerd/containerd/v2/core/runtime/restart"
"github.com/containerd/errdefs"
gocni "github.com/containerd/go-cni"
"github.com/containerd/log"
"github.com/containerd/go-cni"
"github.com/containerd/nerdctl/v2/cmd/nerdctl/helpers"
"github.com/containerd/nerdctl/v2/pkg/api/types"
"github.com/containerd/nerdctl/v2/pkg/clientutil"
"github.com/containerd/nerdctl/v2/pkg/cmd/compose"
"github.com/containerd/nerdctl/v2/pkg/containerutil"
@ -41,21 +40,21 @@ import (
"github.com/containerd/nerdctl/v2/pkg/portutil"
)
func newComposePsCommand() *cobra.Command {
var composePsCommand = &cobra.Command{
func psCommand() *cobra.Command {
var cmd = &cobra.Command{
Use: "ps [flags] [SERVICE...]",
Short: "List containers of services",
RunE: composePsAction,
RunE: psAction,
SilenceUsage: true,
SilenceErrors: true,
}
composePsCommand.Flags().String("format", "table", "Format the output. Supported values: [table|json]")
composePsCommand.Flags().String("filter", "", "Filter matches containers based on given conditions")
composePsCommand.Flags().StringArray("status", []string{}, "Filter services by status. Values: [paused | restarting | removing | running | dead | created | exited]")
composePsCommand.Flags().BoolP("quiet", "q", false, "Only display container IDs")
composePsCommand.Flags().Bool("services", false, "Display services")
composePsCommand.Flags().BoolP("all", "a", false, "Show all containers (default shows just running)")
return composePsCommand
cmd.Flags().String("format", "table", "Format the output. Supported values: [table|json]")
cmd.Flags().String("filter", "", "Filter matches containers based on given conditions")
cmd.Flags().StringArray("status", []string{}, "Filter services by status. Values: [paused | restarting | removing | running | dead | created | exited]")
cmd.Flags().BoolP("quiet", "q", false, "Only display container IDs")
cmd.Flags().Bool("services", false, "Display services")
cmd.Flags().BoolP("all", "a", false, "Show all containers (default shows just running)")
return cmd
}
type composeContainerPrintable struct {
@ -74,7 +73,7 @@ type composeContainerPrintable struct {
Ports string `json:"-"`
}
func composePsAction(cmd *cobra.Command, args []string) error {
func psAction(cmd *cobra.Command, args []string) error {
globalOptions, err := helpers.ProcessRootCmdFlags(cmd)
if err != nil {
return err
@ -184,9 +183,9 @@ func composePsAction(cmd *cobra.Command, args []string) error {
var p composeContainerPrintable
var err error
if format == "json" {
p, err = composeContainerPrintableJSON(ctx, container)
p, err = composeContainerPrintableJSON(ctx, container, globalOptions)
} else {
p, err = composeContainerPrintableTab(ctx, container)
p, err = composeContainerPrintableTab(ctx, container, globalOptions)
}
if err != nil {
return err
@ -235,7 +234,7 @@ func composePsAction(cmd *cobra.Command, args []string) error {
// composeContainerPrintableTab constructs composeContainerPrintable with fields
// only for console output.
func composeContainerPrintableTab(ctx context.Context, container containerd.Container) (composeContainerPrintable, error) {
func composeContainerPrintableTab(ctx context.Context, container containerd.Container, gOptions types.GlobalCommandOptions) (composeContainerPrintable, error) {
info, err := container.Info(ctx, containerd.WithoutRefreshedMetadata)
if err != nil {
return composeContainerPrintable{}, err
@ -252,6 +251,18 @@ func composeContainerPrintableTab(ctx context.Context, container containerd.Cont
if err != nil {
return composeContainerPrintable{}, err
}
dataStore, err := clientutil.DataStore(gOptions.DataRoot, gOptions.Address)
if err != nil {
return composeContainerPrintable{}, err
}
containerLabels, err := container.Labels(ctx)
if err != nil {
return composeContainerPrintable{}, err
}
ports, err := portutil.LoadPortMappings(dataStore, gOptions.Namespace, info.ID, containerLabels)
if err != nil {
return composeContainerPrintable{}, err
}
return composeContainerPrintable{
Name: info.Labels[labels.Name],
@ -259,13 +270,13 @@ func composeContainerPrintableTab(ctx context.Context, container containerd.Cont
Command: formatter.InspectContainerCommandTrunc(spec),
Service: info.Labels[labels.ComposeService],
State: status,
Ports: formatter.FormatPorts(info.Labels),
Ports: formatter.FormatPorts(ports),
}, nil
}
// composeContainerPrintableJSON constructs composeContainerPrintable with fields
// only for json output and compatible docker output.
func composeContainerPrintableJSON(ctx context.Context, container containerd.Container) (composeContainerPrintable, error) {
func composeContainerPrintableJSON(ctx context.Context, container containerd.Container, gOptions types.GlobalCommandOptions) (composeContainerPrintable, error) {
info, err := container.Info(ctx, containerd.WithoutRefreshedMetadata)
if err != nil {
return composeContainerPrintable{}, err
@ -295,6 +306,18 @@ func composeContainerPrintableJSON(ctx context.Context, container containerd.Con
if err != nil {
return composeContainerPrintable{}, err
}
dataStore, err := clientutil.DataStore(gOptions.DataRoot, gOptions.Address)
if err != nil {
return composeContainerPrintable{}, err
}
containerLabels, err := container.Labels(ctx)
if err != nil {
return composeContainerPrintable{}, err
}
portMappings, err := portutil.LoadPortMappings(dataStore, gOptions.Namespace, info.ID, containerLabels)
if err != nil {
return composeContainerPrintable{}, err
}
return composeContainerPrintable{
ID: container.ID(),
@ -306,7 +329,7 @@ func composeContainerPrintableJSON(ctx context.Context, container containerd.Con
State: state,
Health: "",
ExitCode: exitCode,
Publishers: formatPublishers(info.Labels),
Publishers: formatPublishers(portMappings),
}, nil
}
@ -322,8 +345,8 @@ type PortPublisher struct {
// formatPublishers parses and returns docker-compatible []PortPublisher from
// label map. If an error happens, an empty slice is returned.
func formatPublishers(labelMap map[string]string) []PortPublisher {
mapper := func(pm gocni.PortMapping) PortPublisher {
func formatPublishers(portMappings []cni.PortMapping) []PortPublisher {
mapper := func(pm cni.PortMapping) PortPublisher {
return PortPublisher{
URL: pm.HostIP,
TargetPort: int(pm.ContainerPort),
@ -333,22 +356,14 @@ func formatPublishers(labelMap map[string]string) []PortPublisher {
}
var dockerPorts []PortPublisher
if portMappings, err := portutil.ParsePortsLabel(labelMap); err == nil {
for _, p := range portMappings {
dockerPorts = append(dockerPorts, mapper(p))
}
} else {
log.L.Error(err.Error())
for _, p := range portMappings {
dockerPorts = append(dockerPorts, mapper(p))
}
return dockerPorts
}
// statusForFilter returns the status value to be matched with the 'status' filter
func statusForFilter(ctx context.Context, c containerd.Container) string {
// Just in case, there is something wrong in server.
ctx, cancel := context.WithTimeout(ctx, 5*time.Second)
defer cancel()
task, err := c.Task(ctx, nil)
if err != nil {
// NOTE: NotFound doesn't mean that container hasn't started.

View File

@ -32,14 +32,10 @@ import (
func TestComposePs(t *testing.T) {
base := testutil.NewBase(t)
var dockerComposeYAML = fmt.Sprintf(`
version: '3.1'
services:
wordpress:
image: %s
container_name: wordpress_container
ports:
- 8080:80
environment:
WORDPRESS_DB_HOST: db
WORDPRESS_DB_USER: exampleuser
@ -64,7 +60,7 @@ services:
volumes:
wordpress:
db:
`, testutil.WordpressImage, testutil.MariaDBImage, testutil.AlpineImage)
`, testutil.WordpressImage, testutil.MariaDBImage, testutil.CommonImage)
comp := testutil.NewComposeDir(t, dockerComposeYAML)
defer comp.CleanUp()
projectName := comp.ProjectName()
@ -100,9 +96,9 @@ volumes:
time.Sleep(3 * time.Second)
base.ComposeCmd("-f", comp.YAMLFullPath(), "ps", "wordpress").AssertOutWithFunc(assertHandler("wordpress_container", testutil.WordpressImage))
base.ComposeCmd("-f", comp.YAMLFullPath(), "ps", "db").AssertOutWithFunc(assertHandler("db_container", testutil.MariaDBImage))
base.ComposeCmd("-f", comp.YAMLFullPath(), "ps").AssertOutNotContains(testutil.AlpineImage)
base.ComposeCmd("-f", comp.YAMLFullPath(), "ps", "alpine", "-a").AssertOutWithFunc(assertHandler("alpine_container", testutil.AlpineImage))
base.ComposeCmd("-f", comp.YAMLFullPath(), "ps", "-a", "--filter", "status=exited").AssertOutWithFunc(assertHandler("alpine_container", testutil.AlpineImage))
base.ComposeCmd("-f", comp.YAMLFullPath(), "ps").AssertOutNotContains(testutil.CommonImage)
base.ComposeCmd("-f", comp.YAMLFullPath(), "ps", "alpine", "-a").AssertOutWithFunc(assertHandler("alpine_container", testutil.CommonImage))
base.ComposeCmd("-f", comp.YAMLFullPath(), "ps", "-a", "--filter", "status=exited").AssertOutWithFunc(assertHandler("alpine_container", testutil.CommonImage))
base.ComposeCmd("-f", comp.YAMLFullPath(), "ps", "--services", "-a").AssertOutContainsAll("wordpress\n", "db\n", "alpine\n")
}
@ -112,8 +108,6 @@ func TestComposePsJSON(t *testing.T) {
base := testutil.NewBase(t)
var dockerComposeYAML = fmt.Sprintf(`
version: '3.1'
services:
wordpress:
image: %s

View File

@ -25,19 +25,19 @@ import (
"github.com/containerd/nerdctl/v2/pkg/composer"
)
func newComposePullCommand() *cobra.Command {
var composePullCommand = &cobra.Command{
func pullCommand() *cobra.Command {
var cmd = &cobra.Command{
Use: "pull [flags] [SERVICE...]",
Short: "Pull service images",
RunE: composePullAction,
RunE: pullAction,
SilenceUsage: true,
SilenceErrors: true,
}
composePullCommand.Flags().BoolP("quiet", "q", false, "Pull without printing progress information")
return composePullCommand
cmd.Flags().BoolP("quiet", "q", false, "Pull without printing progress information")
return cmd
}
func composePullAction(cmd *cobra.Command, args []string) error {
func pullAction(cmd *cobra.Command, args []string) error {
globalOptions, err := helpers.ProcessRootCmdFlags(cmd)
if err != nil {
return err

View File

@ -26,14 +26,10 @@ import (
func TestComposePullWithService(t *testing.T) {
base := testutil.NewBase(t)
var dockerComposeYAML = fmt.Sprintf(`
version: '3.1'
services:
wordpress:
image: %s
ports:
- 8080:80
environment:
WORDPRESS_DB_HOST: db
WORDPRESS_DB_USER: exampleuser

View File

@ -25,18 +25,18 @@ import (
"github.com/containerd/nerdctl/v2/pkg/composer"
)
func newComposePushCommand() *cobra.Command {
var composePushCommand = &cobra.Command{
func pushCommand() *cobra.Command {
var cmd = &cobra.Command{
Use: "push [flags] [SERVICE...]",
Short: "Push service images",
RunE: composePushAction,
RunE: pushAction,
SilenceUsage: true,
SilenceErrors: true,
}
return composePushCommand
return cmd
}
func composePushAction(cmd *cobra.Command, args []string) error {
func pushAction(cmd *cobra.Command, args []string) error {
globalOptions, err := helpers.ProcessRootCmdFlags(cmd)
if err != nil {
return err

View File

@ -25,19 +25,19 @@ import (
"github.com/containerd/nerdctl/v2/pkg/composer"
)
func newComposeRestartCommand() *cobra.Command {
var composeRestartCommand = &cobra.Command{
func restartCommand() *cobra.Command {
var cmd = &cobra.Command{
Use: "restart [flags] [SERVICE...]",
Short: "Restart containers of given (or all) services",
RunE: composeRestartAction,
RunE: restartAction,
SilenceUsage: true,
SilenceErrors: true,
}
composeRestartCommand.Flags().UintP("timeout", "t", 10, "Seconds to wait before restarting them")
return composeRestartCommand
cmd.Flags().UintP("timeout", "t", 10, "Seconds to wait before restarting them")
return cmd
}
func composeRestartAction(cmd *cobra.Command, args []string) error {
func restartAction(cmd *cobra.Command, args []string) error {
globalOptions, err := helpers.ProcessRootCmdFlags(cmd)
if err != nil {
return err

View File

@ -26,13 +26,9 @@ import (
func TestComposeRestart(t *testing.T) {
base := testutil.NewBase(t)
var dockerComposeYAML = fmt.Sprintf(`
version: '3.1'
services:
wordpress:
image: %s
ports:
- 8080:80
environment:
WORDPRESS_DB_HOST: db
WORDPRESS_DB_USER: exampleuser

View File

@ -28,21 +28,21 @@ import (
"github.com/containerd/nerdctl/v2/pkg/composer"
)
func newComposeRemoveCommand() *cobra.Command {
var composeRemoveCommand = &cobra.Command{
func removeCommand() *cobra.Command {
var cmd = &cobra.Command{
Use: "rm [flags] [SERVICE...]",
Short: "Remove stopped service containers",
RunE: composeRemoveAction,
RunE: removeAction,
SilenceUsage: true,
SilenceErrors: true,
}
composeRemoveCommand.Flags().BoolP("force", "f", false, "Do not prompt for confirmation")
composeRemoveCommand.Flags().BoolP("stop", "s", false, "Stop containers before removing")
composeRemoveCommand.Flags().BoolP("volumes", "v", false, "Remove anonymous volumes associated with containers")
return composeRemoveCommand
cmd.Flags().BoolP("force", "f", false, "Do not prompt for confirmation")
cmd.Flags().BoolP("stop", "s", false, "Stop containers before removing")
cmd.Flags().BoolP("volumes", "v", false, "Remove anonymous volumes associated with containers")
return cmd
}
func composeRemoveAction(cmd *cobra.Command, args []string) error {
func removeAction(cmd *cobra.Command, args []string) error {
globalOptions, err := helpers.ProcessRootCmdFlags(cmd)
if err != nil {
return err

View File

@ -18,23 +18,23 @@ package compose
import (
"fmt"
"regexp"
"testing"
"time"
"github.com/containerd/nerdctl/mod/tigron/expect"
"github.com/containerd/nerdctl/mod/tigron/test"
"github.com/containerd/nerdctl/mod/tigron/tig"
"github.com/containerd/nerdctl/v2/pkg/testutil"
"github.com/containerd/nerdctl/v2/pkg/testutil/nerdtest"
)
func TestComposeRemove(t *testing.T) {
base := testutil.NewBase(t)
var dockerComposeYAML = fmt.Sprintf(`
version: '3.1'
services:
wordpress:
image: %s
ports:
- 8080:80
environment:
WORDPRESS_DB_HOST: db
WORDPRESS_DB_USER: exampleuser
@ -58,27 +58,71 @@ volumes:
db:
`, testutil.WordpressImage, testutil.MariaDBImage)
comp := testutil.NewComposeDir(t, dockerComposeYAML)
defer comp.CleanUp()
projectName := comp.ProjectName()
t.Logf("projectName=%q", projectName)
testCase := nerdtest.Setup()
base.ComposeCmd("-f", comp.YAMLFullPath(), "up", "-d").AssertOK()
defer base.ComposeCmd("-f", comp.YAMLFullPath(), "down", "-v").Run()
testCase.Cleanup = func(data test.Data, helpers test.Helpers) {
helpers.Anyhow("compose", "-f", data.Temp().Path("compose.yaml"), "down")
}
// no stopped containers
base.ComposeCmd("-f", comp.YAMLFullPath(), "rm", "-f").AssertOK()
time.Sleep(3 * time.Second)
base.ComposeCmd("-f", comp.YAMLFullPath(), "ps", "wordpress").AssertOutContainsAny("Up", "running")
base.ComposeCmd("-f", comp.YAMLFullPath(), "ps", "db").AssertOutContainsAny("Up", "running")
// remove one stopped service
base.ComposeCmd("-f", comp.YAMLFullPath(), "stop", "wordpress").AssertOK()
base.ComposeCmd("-f", comp.YAMLFullPath(), "rm", "-f", "wordpress").AssertOK()
time.Sleep(3 * time.Second)
base.ComposeCmd("-f", comp.YAMLFullPath(), "ps", "wordpress").AssertOutNotContains("wordpress")
base.ComposeCmd("-f", comp.YAMLFullPath(), "ps", "db").AssertOutContainsAny("Up", "running")
// remove all services with `--stop`
base.ComposeCmd("-f", comp.YAMLFullPath(), "rm", "-f", "-s").AssertOK()
time.Sleep(3 * time.Second)
base.ComposeCmd("-f", comp.YAMLFullPath(), "ps", "db").AssertOutNotContains("db")
testCase.Setup = func(data test.Data, helpers test.Helpers) {
data.Temp().Save(dockerComposeYAML, "compose.yaml")
helpers.Ensure("compose", "-f", data.Temp().Path("compose.yaml"), "up", "-d")
data.Labels().Set("yamlPath", data.Temp().Path("compose.yaml"))
}
testCase.SubTests = []*test.Case{
{
Description: "All services are still up",
NoParallel: true,
Command: func(data test.Data, helpers test.Helpers) test.TestableCommand {
return helpers.Command("compose", "-f", data.Labels().Get("yamlPath"), "rm", "-f")
},
Expected: func(data test.Data, helpers test.Helpers) *test.Expected {
return &test.Expected{
Output: func(stdout string, t tig.T) {
wp := helpers.Capture("compose", "-f", data.Labels().Get("yamlPath"), "ps", "wordpress")
db := helpers.Capture("compose", "-f", data.Labels().Get("yamlPath"), "ps", "db")
comp := expect.Match(regexp.MustCompile("Up|running"))
comp(wp, t)
comp(db, t)
},
}
},
},
{
Description: "Remove stopped service",
NoParallel: true,
Command: func(data test.Data, helpers test.Helpers) test.TestableCommand {
helpers.Ensure("compose", "-f", data.Labels().Get("yamlPath"), "stop", "wordpress")
return helpers.Command("compose", "-f", data.Labels().Get("yamlPath"), "rm", "-f")
},
Expected: func(data test.Data, helpers test.Helpers) *test.Expected {
return &test.Expected{
Output: func(stdout string, t tig.T) {
wp := helpers.Capture("compose", "-f", data.Labels().Get("yamlPath"), "ps", "wordpress")
db := helpers.Capture("compose", "-f", data.Labels().Get("yamlPath"), "ps", "db")
expect.DoesNotContain("wordpress")(wp, t)
expect.Match(regexp.MustCompile("Up|running"))(db, t)
},
}
},
},
{
Description: "Remove all services with stop",
NoParallel: true,
Command: func(data test.Data, helpers test.Helpers) test.TestableCommand {
return helpers.Command("compose", "-f", data.Labels().Get("yamlPath"), "rm", "-f", "-s")
},
Expected: func(data test.Data, helpers test.Helpers) *test.Expected {
return &test.Expected{
Output: func(stdout string, t tig.T) {
db := helpers.Capture("compose", "-f", data.Labels().Get("yamlPath"), "ps", "db")
expect.DoesNotContain("db")(db, t)
},
}
},
},
}
testCase.Run(t)
}

View File

@ -28,48 +28,48 @@ import (
"github.com/containerd/nerdctl/v2/pkg/composer"
)
func newComposeRunCommand() *cobra.Command {
var composeRunCommand = &cobra.Command{
func runCommand() *cobra.Command {
var cmd = &cobra.Command{
Use: "run [flags] SERVICE [COMMAND] [ARGS...]",
Short: "Run a one-off command on a service",
Args: cobra.MinimumNArgs(1),
RunE: composeRunAction,
RunE: runAction,
SilenceUsage: true,
SilenceErrors: true,
DisableFlagsInUseLine: true,
}
composeRunCommand.Flags().SetInterspersed(false)
composeRunCommand.Flags().BoolP("detach", "d", false, "Detached mode: Run containers in the background")
composeRunCommand.Flags().Bool("no-build", false, "Don't build an image, even if it's missing.")
composeRunCommand.Flags().Bool("no-color", false, "Produce monochrome output")
composeRunCommand.Flags().Bool("no-log-prefix", false, "Don't print prefix in logs")
composeRunCommand.Flags().Bool("build", false, "Build images before starting containers.")
composeRunCommand.Flags().Bool("quiet-pull", false, "Pull without printing progress information")
composeRunCommand.Flags().Bool("remove-orphans", false, "Remove containers for services not defined in the Compose file.")
cmd.Flags().SetInterspersed(false)
cmd.Flags().BoolP("detach", "d", false, "Detached mode: Run containers in the background")
cmd.Flags().Bool("no-build", false, "Don't build an image, even if it's missing.")
cmd.Flags().Bool("no-color", false, "Produce monochrome output")
cmd.Flags().Bool("no-log-prefix", false, "Don't print prefix in logs")
cmd.Flags().Bool("build", false, "Build images before starting containers.")
cmd.Flags().Bool("quiet-pull", false, "Pull without printing progress information")
cmd.Flags().Bool("remove-orphans", false, "Remove containers for services not defined in the Compose file.")
composeRunCommand.Flags().String("name", "", "Assign a name to the container")
composeRunCommand.Flags().Bool("no-deps", false, "Don't start dependencies")
cmd.Flags().String("name", "", "Assign a name to the container")
cmd.Flags().Bool("no-deps", false, "Don't start dependencies")
// TODO: no-TTY flag
// In docker-compose's documentation, no-TTY is automatically detected
// But, it follows `-i` flag because currently `run` command needs `-it` simultaneously.
composeRunCommand.Flags().BoolP("interactive", "i", true, "Keep STDIN open even if not attached")
composeRunCommand.Flags().Bool("rm", false, "Automatically remove the container when it exits")
composeRunCommand.Flags().StringP("user", "u", "", "Username or UID (format: <name|uid>[:<group|gid>])")
composeRunCommand.Flags().StringArrayP("volume", "v", nil, "Bind mount a volume")
composeRunCommand.Flags().StringArray("entrypoint", nil, "Overwrite the default ENTRYPOINT of the image")
composeRunCommand.Flags().StringArrayP("env", "e", nil, "Set environment variables")
composeRunCommand.Flags().StringArrayP("label", "l", nil, "Set metadata on container")
composeRunCommand.Flags().StringP("workdir", "w", "", "Working directory inside the container")
cmd.Flags().BoolP("interactive", "i", true, "Keep STDIN open even if not attached")
cmd.Flags().Bool("rm", false, "Automatically remove the container when it exits")
cmd.Flags().StringP("user", "u", "", "Username or UID (format: <name|uid>[:<group|gid>])")
cmd.Flags().StringArrayP("volume", "v", nil, "Bind mount a volume")
cmd.Flags().StringArray("entrypoint", nil, "Overwrite the default ENTRYPOINT of the image")
cmd.Flags().StringArrayP("env", "e", nil, "Set environment variables")
cmd.Flags().StringArrayP("label", "l", nil, "Set metadata on container")
cmd.Flags().StringP("workdir", "w", "", "Working directory inside the container")
// FIXME: `-p` conflicts with the `--project-name` in PersistentFlags of parent command `compose`
// For docker compatibility, it should be fixed.
composeRunCommand.Flags().StringSlice("publish", nil, "Publish a container's port(s) to the host")
composeRunCommand.Flags().Bool("service-ports", false, "Run command with the service's ports enabled and mapped to the host")
cmd.Flags().StringSlice("publish", nil, "Publish a container's port(s) to the host")
cmd.Flags().Bool("service-ports", false, "Run command with the service's ports enabled and mapped to the host")
// TODO: use-aliases
return composeRunCommand
return cmd
}
func composeRunAction(cmd *cobra.Command, args []string) error {
func runAction(cmd *cobra.Command, args []string) error {
globalOptions, err := helpers.ProcessRootCmdFlags(cmd)
if err != nil {
return err

View File

@ -26,81 +26,90 @@ import (
"gotest.tools/v3/assert"
"github.com/containerd/log"
"github.com/containerd/nerdctl/mod/tigron/expect"
"github.com/containerd/nerdctl/mod/tigron/test"
"github.com/containerd/nerdctl/v2/cmd/nerdctl/helpers"
"github.com/containerd/nerdctl/v2/pkg/testutil"
"github.com/containerd/nerdctl/v2/pkg/testutil/nerdtest"
"github.com/containerd/nerdctl/v2/pkg/testutil/nettestutil"
"github.com/containerd/nerdctl/v2/pkg/testutil/testregistry"
)
func TestComposeRun(t *testing.T) {
base := testutil.NewBase(t)
// specify the name of container in order to remove
// TODO: when `compose rm` is implemented, replace it.
containerName := testutil.Identifier(t)
const expectedOutput = "speed 38400 baud"
dockerComposeYAML := fmt.Sprintf(`
version: '3.1'
services:
alpine:
image: %s
entrypoint:
- stty
`, testutil.AlpineImage)
`, testutil.CommonImage)
comp := testutil.NewComposeDir(t, dockerComposeYAML)
defer comp.CleanUp()
projectName := comp.ProjectName()
t.Logf("projectName=%q", projectName)
defer base.ComposeCmd("-f", comp.YAMLFullPath(), "down", "-v").Run()
testCase := nerdtest.Setup()
defer base.Cmd("rm", "-f", "-v", containerName).Run()
const sttyPartialOutput = "speed 38400 baud"
// unbuffer(1) emulates tty, which is required by `nerdctl run -t`.
// unbuffer(1) can be installed with `apt-get install expect`.
unbuffer := []string{"unbuffer"}
base.ComposeCmdWithHelper(unbuffer, "-f", comp.YAMLFullPath(),
"run", "--name", containerName, "alpine").AssertOutContains(sttyPartialOutput)
}
testCase.SubTests = []*test.Case{
{
Description: "pty run",
Setup: func(data test.Data, helpers test.Helpers) {
data.Temp().Save(dockerComposeYAML, "compose.yaml")
},
Command: func(data test.Data, helpers test.Helpers) test.TestableCommand {
cmd := helpers.Command(
"compose",
"-f",
data.Temp().Path("compose.yaml"),
"run",
"--name",
data.Identifier(),
"alpine",
)
cmd.WithPseudoTTY()
return cmd
},
Expected: test.Expects(0, nil, expect.Contains(expectedOutput)),
Cleanup: func(data test.Data, helpers test.Helpers) {
helpers.Anyhow("rm", "-f", "-v", data.Identifier())
helpers.Anyhow("compose", "-f", data.Temp().Path("compose.yaml"), "down", "-v")
},
},
{
Description: "pty run with --rm",
Setup: func(data test.Data, helpers test.Helpers) {
data.Temp().Save(dockerComposeYAML, "compose.yaml")
},
Command: func(data test.Data, helpers test.Helpers) test.TestableCommand {
cmd := helpers.Command(
"compose",
"-f",
data.Temp().Path("compose.yaml"),
"run",
"--name",
data.Identifier(),
"--rm",
"alpine",
)
cmd.WithPseudoTTY()
return cmd
},
Expected: func(data test.Data, helpers test.Helpers) *test.Expected {
// Ensure the container has been removed
capt := helpers.Capture("ps", "-a", "--format=\"{{.Names}}\"")
assert.Assert(t, !strings.Contains(capt, data.Identifier()), capt)
func TestComposeRunWithRM(t *testing.T) {
base := testutil.NewBase(t)
// specify the name of container in order to remove
// TODO: when `compose rm` is implemented, replace it.
containerName := testutil.Identifier(t)
dockerComposeYAML := fmt.Sprintf(`
version: '3.1'
services:
alpine:
image: %s
entrypoint:
- stty
`, testutil.AlpineImage)
comp := testutil.NewComposeDir(t, dockerComposeYAML)
defer comp.CleanUp()
projectName := comp.ProjectName()
t.Logf("projectName=%q", projectName)
defer base.ComposeCmd("-f", comp.YAMLFullPath(), "down", "-v").Run()
defer base.Cmd("rm", "-f", "-v", containerName).Run()
const sttyPartialOutput = "speed 38400 baud"
// unbuffer(1) emulates tty, which is required by `nerdctl run -t`.
// unbuffer(1) can be installed with `apt-get install expect`.
unbuffer := []string{"unbuffer"}
base.ComposeCmdWithHelper(unbuffer, "-f", comp.YAMLFullPath(),
"run", "--name", containerName, "--rm", "alpine").AssertOutContains(sttyPartialOutput)
psCmd := base.Cmd("ps", "-a", "--format=\"{{.Names}}\"")
result := psCmd.Run()
stdoutContent := result.Stdout() + result.Stderr()
assert.Assert(psCmd.Base.T, result.ExitCode == 0, stdoutContent)
if strings.Contains(stdoutContent, containerName) {
log.L.Errorf("test failed, the container %s is not removed", stdoutContent)
t.Fail()
return
return &test.Expected{
Output: expect.Contains(expectedOutput),
}
},
Cleanup: func(data test.Data, helpers test.Helpers) {
helpers.Anyhow("rm", "-f", "-v", data.Identifier())
helpers.Anyhow("compose", "-f", data.Temp().Path("compose.yaml"), "down", "-v")
},
},
}
testCase.Run(t)
}
func TestComposeRunWithServicePorts(t *testing.T) {
@ -110,7 +119,6 @@ func TestComposeRunWithServicePorts(t *testing.T) {
containerName := testutil.Identifier(t)
dockerComposeYAML := fmt.Sprintf(`
version: '3.1'
services:
web:
image: %s
@ -134,7 +142,7 @@ services:
}()
checkNginx := func() error {
resp, err := nettestutil.HTTPGet("http://127.0.0.1:8080", 10, false)
resp, err := nettestutil.HTTPGet("http://127.0.0.1:8080", 5, false)
if err != nil {
return err
}
@ -172,7 +180,6 @@ func TestComposeRunWithPublish(t *testing.T) {
containerName := testutil.Identifier(t)
dockerComposeYAML := fmt.Sprintf(`
version: '3.1'
services:
web:
image: %s
@ -194,7 +201,7 @@ services:
}()
checkNginx := func() error {
resp, err := nettestutil.HTTPGet("http://127.0.0.1:8080", 10, false)
resp, err := nettestutil.HTTPGet("http://127.0.0.1:8080", 5, false)
if err != nil {
return err
}
@ -232,7 +239,6 @@ func TestComposeRunWithEnv(t *testing.T) {
containerName := testutil.Identifier(t)
dockerComposeYAML := fmt.Sprintf(`
version: '3.1'
services:
alpine:
image: %s
@ -240,7 +246,7 @@ services:
- sh
- -c
- "echo $$FOO"
`, testutil.AlpineImage)
`, testutil.CommonImage)
comp := testutil.NewComposeDir(t, dockerComposeYAML)
defer comp.CleanUp()
@ -264,14 +270,13 @@ func TestComposeRunWithUser(t *testing.T) {
containerName := testutil.Identifier(t)
dockerComposeYAML := fmt.Sprintf(`
version: '3.1'
services:
alpine:
image: %s
entrypoint:
- id
- -u
`, testutil.AlpineImage)
`, testutil.CommonImage)
comp := testutil.NewComposeDir(t, dockerComposeYAML)
defer comp.CleanUp()
@ -293,7 +298,6 @@ func TestComposeRunWithLabel(t *testing.T) {
containerName := testutil.Identifier(t)
dockerComposeYAML := fmt.Sprintf(`
version: '3.1'
services:
alpine:
image: %s
@ -302,7 +306,7 @@ services:
- "dummy log"
labels:
- "foo=bar"
`, testutil.AlpineImage)
`, testutil.CommonImage)
comp := testutil.NewComposeDir(t, dockerComposeYAML)
defer comp.CleanUp()
@ -331,13 +335,12 @@ func TestComposeRunWithArgs(t *testing.T) {
containerName := testutil.Identifier(t)
dockerComposeYAML := fmt.Sprintf(`
version: '3.1'
services:
alpine:
image: %s
entrypoint:
- echo
`, testutil.AlpineImage)
`, testutil.CommonImage)
comp := testutil.NewComposeDir(t, dockerComposeYAML)
defer comp.CleanUp()
@ -361,13 +364,12 @@ func TestComposeRunWithEntrypoint(t *testing.T) {
containerName := testutil.Identifier(t)
dockerComposeYAML := fmt.Sprintf(`
version: '3.1'
services:
alpine:
image: %s
entrypoint:
- stty # should be changed
`, testutil.AlpineImage)
`, testutil.CommonImage)
comp := testutil.NewComposeDir(t, dockerComposeYAML)
defer comp.CleanUp()
@ -389,13 +391,12 @@ func TestComposeRunWithVolume(t *testing.T) {
containerName := testutil.Identifier(t)
dockerComposeYAML := fmt.Sprintf(`
version: '3.1'
services:
alpine:
image: %s
entrypoint:
- stty # no meaning, just put any command
`, testutil.AlpineImage)
`, testutil.CommonImage)
comp := testutil.NewComposeDir(t, dockerComposeYAML)
defer comp.CleanUp()
@ -479,7 +480,7 @@ services:
`, imageSvc0, keyPair.PublicKey, keyPair.PrivateKey,
imageSvc1, keyPair.PrivateKey, imageSvc2)
dockerfile := fmt.Sprintf(`FROM %s`, testutil.AlpineImage)
dockerfile := fmt.Sprintf(`FROM %s`, testutil.CommonImage)
comp := testutil.NewComposeDir(t, dockerComposeYAML)
defer comp.CleanUp()

View File

@ -34,19 +34,19 @@ import (
"github.com/containerd/nerdctl/v2/pkg/labels"
)
func newComposeStartCommand() *cobra.Command {
var composeRestartCommand = &cobra.Command{
func startCommand() *cobra.Command {
var cmd = &cobra.Command{
Use: "start [SERVICE...]",
Short: "Start existing containers for service(s)",
RunE: composeStartAction,
RunE: startAction,
SilenceUsage: true,
SilenceErrors: true,
DisableFlagsInUseLine: true,
}
return composeRestartCommand
return cmd
}
func composeStartAction(cmd *cobra.Command, args []string) error {
func startAction(cmd *cobra.Command, args []string) error {
globalOptions, err := helpers.ProcessRootCmdFlags(cmd)
if err != nil {
return err
@ -112,7 +112,7 @@ func startContainers(ctx context.Context, client *containerd.Client, containers
}
// in compose, always disable attach
if err := containerutil.Start(ctx, c, false, client, ""); err != nil {
if err := containerutil.Start(ctx, c, false, false, client, ""); err != nil {
return err
}
info, err := c.Info(ctx, containerd.WithoutRefreshedMetadata)

View File

@ -18,16 +18,19 @@ package compose
import (
"fmt"
"regexp"
"testing"
"github.com/containerd/nerdctl/mod/tigron/expect"
"github.com/containerd/nerdctl/mod/tigron/test"
"github.com/containerd/nerdctl/mod/tigron/tig"
"github.com/containerd/nerdctl/v2/pkg/testutil"
"github.com/containerd/nerdctl/v2/pkg/testutil/nerdtest"
)
func TestComposeStart(t *testing.T) {
base := testutil.NewBase(t)
var dockerComposeYAML = fmt.Sprintf(`
version: '3.1'
services:
svc0:
image: %s
@ -37,50 +40,68 @@ services:
command: "sleep infinity"
`, testutil.CommonImage, testutil.CommonImage)
comp := testutil.NewComposeDir(t, dockerComposeYAML)
defer comp.CleanUp()
projectName := comp.ProjectName()
t.Logf("projectName=%q", projectName)
testCase := nerdtest.Setup()
base.ComposeCmd("-f", comp.YAMLFullPath(), "up", "-d").AssertOK()
defer base.ComposeCmd("-f", comp.YAMLFullPath(), "down", "-v").AssertOK()
testCase.Cleanup = func(data test.Data, helpers test.Helpers) {
helpers.Anyhow("compose", "-f", data.Temp().Path("compose.yaml"), "down")
}
// calling `compose start` after all services up has no effect.
base.ComposeCmd("-f", comp.YAMLFullPath(), "start").AssertOK()
testCase.Setup = func(data test.Data, helpers test.Helpers) {
data.Temp().Save(dockerComposeYAML, "compose.yaml")
helpers.Ensure("compose", "-f", data.Temp().Path("compose.yaml"), "up", "-d")
helpers.Ensure("compose", "-f", data.Temp().Path("compose.yaml"), "start")
helpers.Ensure("compose", "-f", data.Temp().Path("compose.yaml"), "stop", "--timeout", "1", "svc0")
helpers.Ensure("compose", "-f", data.Temp().Path("compose.yaml"), "kill", "svc1")
}
// `compose start`` can start a stopped/killed service container
base.ComposeCmd("-f", comp.YAMLFullPath(), "stop", "--timeout", "1", "svc0").AssertOK()
base.ComposeCmd("-f", comp.YAMLFullPath(), "kill", "svc1").AssertOK()
base.ComposeCmd("-f", comp.YAMLFullPath(), "start").AssertOK()
base.ComposeCmd("-f", comp.YAMLFullPath(), "ps", "svc0").AssertOutContainsAny("Up", "running")
base.ComposeCmd("-f", comp.YAMLFullPath(), "ps", "svc1").AssertOutContainsAny("Up", "running")
testCase.Command = func(data test.Data, helpers test.Helpers) test.TestableCommand {
return helpers.Command("compose", "-f", data.Temp().Path("compose.yaml"), "start")
}
testCase.Expected = func(data test.Data, helpers test.Helpers) *test.Expected {
return &test.Expected{
ExitCode: 0,
Errors: nil,
Output: func(stdout string, t tig.T) {
svc0 := helpers.Capture("compose", "-f", data.Temp().Path("compose.yaml"), "ps", "svc0")
svc1 := helpers.Capture("compose", "-f", data.Temp().Path("compose.yaml"), "ps", "svc1")
comp := expect.Match(regexp.MustCompile("Up|running"))
comp(svc0, t)
comp(svc1, t)
},
}
}
testCase.Run(t)
}
func TestComposeStartFailWhenServicePause(t *testing.T) {
base := testutil.NewBase(t)
switch base.Info().CgroupDriver {
case "none", "":
t.Skip("requires cgroup (for pausing)")
}
var dockerComposeYAML = fmt.Sprintf(`
version: '3.1'
services:
svc0:
image: %s
command: "sleep infinity"
`, testutil.CommonImage)
comp := testutil.NewComposeDir(t, dockerComposeYAML)
defer comp.CleanUp()
projectName := comp.ProjectName()
t.Logf("projectName=%q", projectName)
testCase := nerdtest.Setup()
base.ComposeCmd("-f", comp.YAMLFullPath(), "up", "-d").AssertOK()
defer base.ComposeCmd("-f", comp.YAMLFullPath(), "down", "-v").AssertOK()
testCase.Require = nerdtest.CGroup
// `compose start` cannot start a paused service container
base.ComposeCmd("-f", comp.YAMLFullPath(), "pause", "svc0").AssertOK()
base.ComposeCmd("-f", comp.YAMLFullPath(), "start").AssertFail()
testCase.Cleanup = func(data test.Data, helpers test.Helpers) {
helpers.Anyhow("compose", "-f", data.Temp().Path("compose.yaml"), "down")
}
testCase.Setup = func(data test.Data, helpers test.Helpers) {
data.Temp().Save(dockerComposeYAML, "compose.yaml")
helpers.Ensure("compose", "-f", data.Temp().Path("compose.yaml"), "up", "-d")
helpers.Ensure("compose", "-f", data.Temp().Path("compose.yaml"), "pause", "svc0")
}
testCase.Command = func(data test.Data, helpers test.Helpers) test.TestableCommand {
return helpers.Command("compose", "-f", data.Temp().Path("compose.yaml"), "start")
}
testCase.Expected = test.Expects(expect.ExitCodeGenericFail, nil, nil)
testCase.Run(t)
}

View File

@ -25,19 +25,19 @@ import (
"github.com/containerd/nerdctl/v2/pkg/composer"
)
func newComposeStopCommand() *cobra.Command {
var composeStopCommand = &cobra.Command{
func stopCommand() *cobra.Command {
var cmd = &cobra.Command{
Use: "stop [flags] [SERVICE...]",
Short: "Stop running containers without removing them.",
RunE: composeStopAction,
RunE: stopAction,
SilenceUsage: true,
SilenceErrors: true,
}
composeStopCommand.Flags().UintP("timeout", "t", 10, "Seconds to wait for stop before killing them")
return composeStopCommand
cmd.Flags().UintP("timeout", "t", 10, "Seconds to wait for stop before killing them")
return cmd
}
func composeStopAction(cmd *cobra.Command, args []string) error {
func stopAction(cmd *cobra.Command, args []string) error {
globalOptions, err := helpers.ProcessRootCmdFlags(cmd)
if err != nil {
return err

View File

@ -18,22 +18,22 @@ package compose
import (
"fmt"
"regexp"
"testing"
"github.com/containerd/nerdctl/mod/tigron/expect"
"github.com/containerd/nerdctl/mod/tigron/test"
"github.com/containerd/nerdctl/v2/pkg/testutil"
"github.com/containerd/nerdctl/v2/pkg/testutil/nerdtest"
)
func TestComposeStop(t *testing.T) {
base := testutil.NewBase(t)
var dockerComposeYAML = fmt.Sprintf(`
version: '3.1'
services:
wordpress:
image: %s
ports:
- 8080:80
environment:
WORDPRESS_DB_HOST: db
WORDPRESS_DB_USER: exampleuser
@ -57,21 +57,50 @@ volumes:
db:
`, testutil.WordpressImage, testutil.MariaDBImage)
comp := testutil.NewComposeDir(t, dockerComposeYAML)
defer comp.CleanUp()
projectName := comp.ProjectName()
t.Logf("projectName=%q", projectName)
testCase := nerdtest.Setup()
base.ComposeCmd("-f", comp.YAMLFullPath(), "up", "-d").AssertOK()
defer base.ComposeCmd("-f", comp.YAMLFullPath(), "down", "-v").Run()
testCase.Setup = func(data test.Data, helpers test.Helpers) {
data.Temp().Save(dockerComposeYAML, "compose.yaml")
helpers.Ensure("compose", "-f", data.Temp().Path("compose.yaml"), "up", "-d")
data.Labels().Set("yamlPath", data.Temp().Path("compose.yaml"))
}
// stop should (only) stop the given service.
base.ComposeCmd("-f", comp.YAMLFullPath(), "stop", "db").AssertOK()
base.ComposeCmd("-f", comp.YAMLFullPath(), "ps", "db", "-a").AssertOutContainsAny("Exit", "exited")
base.ComposeCmd("-f", comp.YAMLFullPath(), "ps", "wordpress").AssertOutContainsAny("Up", "running")
testCase.Cleanup = func(data test.Data, helpers test.Helpers) {
helpers.Anyhow("compose", "-f", data.Temp().Path("compose.yaml"), "down")
}
// `--timeout` arg should work properly.
base.ComposeCmd("-f", comp.YAMLFullPath(), "stop", "--timeout", "5", "wordpress").AssertOK()
base.ComposeCmd("-f", comp.YAMLFullPath(), "ps", "wordpress", "-a").AssertOutContainsAny("Exit", "exited")
testCase.SubTests = []*test.Case{
{
Description: "stop db",
NoParallel: true,
Setup: func(data test.Data, helpers test.Helpers) {
helpers.Ensure("compose", "-f", data.Labels().Get("yamlPath"), "stop", "db")
},
Command: func(data test.Data, helpers test.Helpers) test.TestableCommand {
return helpers.Command("compose", "-f", data.Labels().Get("yamlPath"), "ps", "db", "-a")
},
Expected: test.Expects(0, nil, expect.Match(regexp.MustCompile("Exit|exited"))),
},
{
Description: "wordpress is still running",
NoParallel: true,
Command: func(data test.Data, helpers test.Helpers) test.TestableCommand {
return helpers.Command("compose", "-f", data.Labels().Get("yamlPath"), "ps", "wordpress")
},
Expected: test.Expects(0, nil, expect.Match(regexp.MustCompile("Up|running"))),
},
{
Description: "stop wordpress",
NoParallel: true,
Setup: func(data test.Data, helpers test.Helpers) {
helpers.Ensure("compose", "-f", data.Labels().Get("yamlPath"), "stop", "--timeout", "5", "wordpress")
},
Command: func(data test.Data, helpers test.Helpers) test.TestableCommand {
return helpers.Command("compose", "-f", data.Labels().Get("yamlPath"), "ps", "wordpress", "-a")
},
Expected: test.Expects(0, nil, expect.Match(regexp.MustCompile("Exit|exited"))),
},
}
testCase.Run(t)
}

View File

@ -32,19 +32,19 @@ import (
"github.com/containerd/nerdctl/v2/pkg/labels"
)
func newComposeTopCommand() *cobra.Command {
var composeTopCommand = &cobra.Command{
func topCommand() *cobra.Command {
var cmd = &cobra.Command{
Use: "top [SERVICE...]",
Short: "Display the running processes of service containers",
RunE: composeTopAction,
RunE: topAction,
SilenceUsage: true,
SilenceErrors: true,
DisableFlagsInUseLine: true,
}
return composeTopCommand
return cmd
}
func composeTopAction(cmd *cobra.Command, args []string) error {
func topAction(cmd *cobra.Command, args []string) error {
globalOptions, err := helpers.ProcessRootCmdFlags(cmd)
if err != nil {
return err

Some files were not shown because too many files have changed in this diff Show More