Commit Graph

119 Commits

Author SHA1 Message Date
Marcin Rataj
82fef0c045
feat(ci): docker linting (#10927)
Some checks failed
CodeQL / codeql (push) Has been cancelled
Docker Check / lint (push) Has been cancelled
Docker Check / build (push) Has been cancelled
Gateway Conformance / gateway-conformance (push) Has been cancelled
Gateway Conformance / gateway-conformance-libp2p-experiment (push) Has been cancelled
Go Build / go-build (push) Has been cancelled
Go Check / go-check (push) Has been cancelled
Go Lint / go-lint (push) Has been cancelled
Go Test / go-test (push) Has been cancelled
Interop / interop-prep (push) Has been cancelled
Sharness / sharness-test (push) Has been cancelled
Spell Check / spellcheck (push) Has been cancelled
Interop / helia-interop (push) Has been cancelled
Interop / ipfs-webui (push) Has been cancelled
* feat(ci): docker linting

adds hadolint to validate dockerfile best practices
configures project-specific rules in .hadolint.yaml

* fix(ci): enable hadolint console output

adds verbose and tty format to see linting results in CI logs

* test: trigger hadolint warning

remove --no-install-recommends to test CI output

* fix(ci): fail hadolint on warnings

stricter linting to catch all best practice violations

* fix: add --no-install-recommends to apt-get

reduces image size by avoiding unnecessary packages

* refactor: use WORKDIR instead of cd in dockerfile

replaces cd commands with WORKDIR for cleaner dockerfile
removes unnecessary hadolint ignore rules DL3003 and DL3009

* chore: simplify hadolint config

removes unnecessary override rules for cleaner config
2025-08-26 17:01:06 +02:00
Marcin Rataj
c12d24949c
feat: optimize docker builds (#10925)
* feat(docker): optimize Dockerfile for faster builds

- add BuildKit syntax directive for advanced caching features
- implement cache mounts for Go modules and build cache
- reduce layers by combining RUN commands (5→2 in final stage)
- optimize apt-get with --no-install-recommends flag
- use COPY --chmod to avoid separate permission fixing

Performance improvements:
- incremental builds after code changes: ~8.6x faster (1m51s → 13s)
- go module/build cache persists between builds
- reduced layer count improves cache efficiency

* ci: optimize Docker builds with BuildKit caching

- enable BuildKit with GitHub Actions cache backend
- add Docker Hub registry cache for cross-workflow sharing
- move Docker login earlier to enable registry cache writes
- use dual cache strategy (gha + registry) for faster builds

expected improvements:
- PR builds can reuse main branch cache from Docker Hub
- rebuild after code changes ~5-10x faster with persistent cache
- cross-PR cache sharing reduces redundant builds
2025-08-21 14:44:19 +02:00
Andrew Gillis
501b1f8bc3
feat: require go1.25 for building kubo (#10913)
Some checks are pending
CodeQL / codeql (push) Waiting to run
Docker Build / docker-build (push) Waiting to run
Gateway Conformance / gateway-conformance (push) Waiting to run
Gateway Conformance / gateway-conformance-libp2p-experiment (push) Waiting to run
Go Build / go-build (push) Waiting to run
Go Check / go-check (push) Waiting to run
Go Lint / go-lint (push) Waiting to run
Go Test / go-test (push) Waiting to run
Interop / interop-prep (push) Waiting to run
Interop / helia-interop (push) Blocked by required conditions
Interop / ipfs-webui (push) Blocked by required conditions
Sharness / sharness-test (push) Waiting to run
Spell Check / spellcheck (push) Waiting to run
* Require go1.25 for building kubo
* update Dockerfile to fix warnings
2025-08-13 18:01:50 -07:00
Marcin Rataj
8e5ef5503d
fix(ci): docker build (#10914)
* fix(ci): pass -buildvcs=false to go list in Makefile

Docker builds were failing because go list commands in mk/golang.mk
didn't inherit GOFLAGS from the environment, causing empty package
names when .git directory was incomplete.

This issue always existed but was masked until recent changes in
GitHub Actions runners or Docker golang image exposed it.

* fix(ci): use modern ENV key=value format in Dockerfile

Fixes Docker build deprecation warnings.
2025-08-14 01:49:35 +02:00
Marcin Rataj
6e3ae8f263 fix(ci): switch to debian:bookworm-slim
Fixes https://github.com/ipfs/kubo/actions/runs/16871954614/job/47788281700?pr=10905#step:5:8

- Debian 13 "Trixie" became stable on August 9, 2025 (just 2 days ago!)
- CI gets Debian 13 (GLIBC 2.38+) when pulling debian:stable-slim
- Busybox still has GLIBC 2.36
- The tini binary compiled on Debian 13 requires GLIBC 2.38

(cherry picked from commit 4db7d96e9a)
2025-08-11 21:21:54 +02:00
Marcin Rataj
fffdec3584 chore: ensure /mfs is present in docker
Some checks are pending
CodeQL / codeql (push) Waiting to run
Docker Build / docker-build (push) Waiting to run
Gateway Conformance / gateway-conformance (push) Waiting to run
Gateway Conformance / gateway-conformance-libp2p-experiment (push) Waiting to run
Go Build / go-build (push) Waiting to run
Go Check / go-check (push) Waiting to run
Go Lint / go-lint (push) Waiting to run
Go Test / go-test (push) Waiting to run
Interop / interop-prep (push) Waiting to run
Interop / helia-interop (push) Blocked by required conditions
Interop / ipfs-webui (push) Blocked by required conditions
Sharness / sharness-test (push) Waiting to run
Spell Check / spellcheck (push) Waiting to run
2025-05-06 21:56:49 +02:00
Andrew Gillis
8f07460ab3
Upgrade to go1.24 (#10726)
* Upgrade to go1.24
* fix test to look for new version info string
2025-02-24 14:46:20 -08:00
Russell Dempsey
40a7a388a4
fix: switch away from IPFS_LOG_LEVEL (#10694)
Some checks failed
CodeQL / codeql (push) Has been cancelled
Docker Build / docker-build (push) Has been cancelled
Gateway Conformance / gateway-conformance (push) Has been cancelled
Gateway Conformance / gateway-conformance-libp2p-experiment (push) Has been cancelled
Go Build / go-build (push) Has been cancelled
Go Check / go-check (push) Has been cancelled
Go Lint / go-lint (push) Has been cancelled
Go Test / go-test (push) Has been cancelled
Interop / interop-prep (push) Has been cancelled
Sharness / sharness-test (push) Has been cancelled
Spell Check / spellcheck (push) Has been cancelled
Interop / helia-interop (push) Has been cancelled
Interop / ipfs-webui (push) Has been cancelled
2025-02-14 18:25:31 +00:00
Marcin Rataj
091bc083c3
fix: go 1.23(.2) (#10540)
Some checks failed
CodeQL / codeql (push) Has been cancelled
Docker Build / docker-build (push) Has been cancelled
Gateway Conformance / gateway-conformance (push) Has been cancelled
Gateway Conformance / gateway-conformance-libp2p-experiment (push) Has been cancelled
Go Build / go-build (push) Has been cancelled
Go Check / go-check (push) Has been cancelled
Go Lint / go-lint (push) Has been cancelled
Go Test / go-test (push) Has been cancelled
Interop / interop-prep (push) Has been cancelled
Sharness / sharness-test (push) Has been cancelled
Interop / helia-interop (push) Has been cancelled
Interop / ipfs-webui (push) Has been cancelled
go1.23.2 includes potential fix for issue described in
https://github.com/ipfs/kubo/issues/10501
2024-10-08 17:16:02 +02:00
Marcin Rataj
23ca1ddab1
fix: switch back to go 1.22 (#10502)
Switching back until https://github.com/ipfs/kubo/issues/10501 is resolved.
2024-09-02 23:39:16 +02:00
Marcin Rataj
2260e35df2
chore: upgrade to go 1.23 (#10486)
* chore: upgrade to go 1.23

https://tip.golang.org/doc/go1.23

* refactor: golangci-lint v1.60.2
2024-08-28 18:56:45 +02:00
Henrique Dias
d60b7cd1b1
ci: upgrade to go 1.22 (#10355) 2024-03-05 08:37:34 +01:00
Johannes Maria Frank
00e26e9396
fix(docker): allow nofuse builds for MacOS (#10135) 2023-09-22 15:40:02 +02:00
Adin Schmahmann
a9737e4d6a chore: update to build with Go 1.21 2023-09-18 17:05:32 +02:00
Jorropo
8ac25bbbef dockerfile: reorder copy order for better layer caching
Because Kubo is the part changing more often it's better to copy after so docker can reuse the utilities layers.
2023-08-23 22:18:01 +02:00
Henrique Dias
2aa721b121 chore: bump to go 1.20
- Bumps golangci-lint to work for the new Go version
- Removes rand.Seed, which has been deprecated. It is seeded by default
  with a random value since Go 1.20.
- Replaces deprecated Fuse errors with syscall.Errno
2023-08-22 15:43:01 +02:00
Jorropo
b3e8ddf717 docker: change to releases that follow debian's updates 2023-08-19 01:11:26 +02:00
Jorropo
af2bdf1e00 docker: bump debian version to bookworm 2023-08-18 20:16:35 +02:00
Piotr Galar
c5868a86be
refactor(ci): simplify Dockerfile and add docker image testing (#10021) 2023-07-27 19:53:24 +02:00
Dennis Trautwein
1972a49f91 fix: docker repository initialization race condition
When running the health check command without passing the `--api` command line flag and if the Kubo daemon is not active, executing `ipfs dag stat` will initialize the repository. It is common for the health check command to be run with root privileges. As a result, the repository will be owned by the root user. Then, if the Kubo daemon process attempts to access the repository later on, it will encounter a permission denied error because it runs as a non-privileged user by default.

Hence, this modification simply provides the `--api` flag to the `ipfs dag stat` command. Given that we are operating within the limited confines of a docker container, we can make a few assumptions. I can't come up with a scenario where one would desire to assign a different port to the internal API rather than using the default 5001. Therefore, I have hard-coded the value accordingly.
2023-06-27 12:45:24 +02:00
Jorropo
23f01232c9 ci: bump go version to 1.19.x across the whole board
We were quite inconsistent about this previously, some files used 1.19.1 some 1.19.x, this makes it more consistent.
2023-06-08 10:05:30 +02:00
Marcin Rataj
6f08cdedc0
fix(ci): speed up docker build (#9800)
trying two things:
- speed up arm build by allowing cross-comp from go instead of slow QEMU
- take a stab at caching buildx layers, without infinite growth

This fix was laready applied in
14cfa48bed
and reduced build time from 20m to 3m.
2023-04-06 20:53:52 +02:00
Marcin Rataj
3b00c81c8d docs: remove snap and chocolatey packages
See
https://github.com/ipfs/kubo/issues/8688
https://github.com/ipfs/kubo/issues/9341
2022-11-28 15:55:57 +01:00
dbadoy4874
97550ac802 docs: small typo in Dockerfile 2022-09-15 17:14:09 +02:00
Jorropo
196887cbe5 chore: bump go-libp2p v0.22.0 & go1.18&go1.19
Fixes: #9225
2022-09-09 17:09:38 +02:00
Antonio Navarro Perez
ea9c22130b chore: bump Go version to 1.18.5
Signed-off-by: Antonio Navarro Perez <antnavper@gmail.com>
2022-08-23 10:10:57 +02:00
Marcin Rataj
b9240fe432 refactor(docker): publish images under both names
This ensures we keep publishing the same image under both names:

    $ ./bin/get-docker-tags.sh $(date -u +%F) 88d88158c master                                                                                                                                 ...chore/rename-to-banana
    ipfs/kubo:master-2022-06-21-88d8815
    ipfs/go-ipfs:master-2022-06-21-88d8815
    ipfs/kubo:master-latest
    ipfs/go-ipfs:master-latest
2022-07-06 18:40:39 +02:00
Adin Schmahmann
9db6641efd
chore: bump Go to 1.18.3 (#9021) 2022-06-08 15:33:06 -04:00
Adin Schmahmann
ff832cb992 docker: disable buildvcs for docker builds 2022-05-04 14:53:54 -04:00
Adin Schmahmann
8ec5718c56 chore: build with go 1.18.1 2022-05-04 14:53:54 -04:00
Adin Schmahmann
d59730f51e
Update Go version to 1.17 (#8815)
* remove building the pre-bundled plugins as shared objects in makefile

* chore: update go version to minimum of 1.17
2022-04-15 14:32:00 -04:00
Caian Benedicto
63b0025664
feat(docker): /container-init.d for advanced initialization (#6577)
* Add initialization directory support to Docker image
* Add sharness test, fix bugs in init script
Fixed in init script:
- Added some missing quotes around expansions
- Fixed INIT_ARGS to not pass any args if IPFS_PROFILE isn't specified
- Use printf instead of "echo -e"
- Only run scripts in top-level of init dir
- Handle filenames correctly when finding init scripts (by using find + xargs)

* chore: docker cleanup
cleans up containers and images (useful when run on developer machine)

* remove container init documentation from README
There is already IPFS Docker documentation where this should live:
https://docs.ipfs.io/how-to/run-ipfs-inside-docker/

Co-authored-by: Caian <caian@ggaunicamp.com>
Co-authored-by: Marcin Rataj <lidel@lidel.org>
Co-authored-by: Gus Eggert <gus@gus.dev>
2022-04-12 19:44:03 +02:00
Adin Schmahmann
d7b60d44fd build: update to Go 1.16.15 2022-04-08 14:42:41 -04:00
Adin Schmahmann
a04b68a641 chore: bump Go version to 1.16.12 2021-12-13 15:57:04 -05:00
Adin Schmahmann
949ebe3ddf chore: bump Go version to 1.16.11 2021-12-09 12:07:32 -05:00
Steve Loeppky
c55fda4d6c
Merge pull request #8482 from ipfs/chore/agent-version-suffix-for-docker 2021-10-12 08:35:33 -07:00
arjunraghurama
6f9351a3ca
Added the missing heathcheck for the container (#8429)
* Added heathcheck for the docker container
2021-10-08 11:27:49 -04:00
Marcin Rataj
9f1ba46af3
chore: agent-version-suffix in docker image
Docker image already produces custom AgentVersion, this makes it
explicit and easier to reason about.
2021-10-02 02:05:05 +02:00
Gus Eggert
70b3882e5a Use Go 1.16.7 2021-08-17 12:20:50 -04:00
Gus Eggert
c40f8d1c80 Update Docker Go version to 1.16.6 2021-08-13 16:33:55 -04:00
Gus Eggert
3a7eaaf7eb Revert "Remove MAKE_SKIP_PATH, update Dockerfile base image"
This reverts commit d3468407aa.
2021-08-13 16:33:31 -04:00
Gus Eggert
d3468407aa Remove MAKE_SKIP_PATH, update Dockerfile base image 2021-08-03 14:23:58 -04:00
Marten Seemann
339fb46ef5 update Go to 1.16.4 on CircleCI 2021-05-15 17:25:54 -07:00
Adin Schmahmann
73e7e023c0 downgrade to 1.15.2 2021-05-12 17:59:20 -04:00
Adin Schmahmann
a81718f20a bump dockerfile to Go 1.15.8 2021-05-12 17:20:44 -04:00
Oli Evans
883ad0d1d2
feat: add snap package configuration
Simplify keeping the snap package up to date by including the snapcraft.yaml in the repo.

We can then wire up the snapstore to autobuild the package for amd64,i386,arm* etc.

Many thanks to @elopio for the work of getting ipfs into the snap store in the first place, and to @bertrandfalguiere and @mkg20001 for pushing it forwards.

See: https://github.com/ipfs-shipyard/ipfs-snap for more info.

Fixes #7250
WIP #3595

License: MIT
Signed-off-by: Oli Evans <oli@tableflip.io>
2020-07-09 11:07:14 +01:00
Steven Allen
1034724ca0 fix: use static binaries in docker container
This is more robust cross-platform/architecture.

fixes #7422
2020-06-23 14:03:23 -07:00
Mark Gaiser
643699e2e8 Use the -p option which makes parents as needed. 2020-06-11 17:11:10 +02:00
@RubenKelevra
179bed8f60 go: bump minimal dependency to 1.14.4
due to major bugfixes in the .4 release
2020-06-05 03:15:57 +02:00
@RubenKelevra
2dc1f691f1 quic: remove experimental status and add it to the default config 2020-05-22 04:54:19 +02:00