Update sysutils/docker-freebsd to new version
source link: https://reviews.freebsd.org/D21570
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
this review is intended to help integrate dockers into FreeBSD
and make them run.
Help is welcome
TODO: runC, libnetwork and containerd
Event Timeline
We can change that. At the moment we are concentrating on the port building. We will then see what "COMMENT" says at the end ... :-)
Update Makefile, Reported by dmgk
Hi, just saw this. I'm keeping an eye on it and am interested in helping where I can. I haven't yet looked at the code, but it's on my agenda in the coming couple of weeks.
What kind of testing is needed on this? I might be able to start there.
(Oh and this is my first time on FreeBSD Phabricator, so if I'm not doing this right, please do let me know)
Further patches have to be applied to remove the errors.
But I don't know if it's worth developing the project further, because Docker is obviously at the end of its life.
Certainly there are lots of questions around Docker-the-company at the moment, but there's still a lot of use and interest today and I would still very much like to see this proceed.
Because @rene deleted the port without asking [1], I set all work here now.
Thanks to everyone who had put time and energy into the project until here
Note: I have WIP updates to fix some of the errors
If anyone has additions/fixed, please provide diffs
@joneum You can abandon revisions instead of accepting/closing. Would you like the remain author on this?
@koobs: i have been searching the days for solutions to the error.
After the port was deleted without consultation, I'm currently not in the mood anymore. I need a few days off, but am still interested in maintaining the port. If you have suggestions for a solution to the problem, I'm open.
I'll use the days to think about whether to give up my commit bit, and just continue as a normal maintainer.
The current incident has once again shown that people no longer communicate with others, but simply do what they want. And that is not my policy. It robs me of the fun.
I'll use the days to think about whether to give up my commit bit, and just continue as a normal maintainer.
The current incident has once again shown that people no longer communicate with others, but simply do what they want. And that is not my policy. It robs me of the fun.
I understand. Hit me up on IRC when you're available and feeling up to it and I can share my diffs :)
Wait, end of life? How? Why? What have I missed?
When a port is broken for more than 6 month, there is a normal procedure that mark it as deprecated and then remove it from the ports tree at expiration date. this is almost automatic; Note that every month there is a notice about this.
The main reason is there is no point in keeping broken ports in base that misdrive users, it is very easy to readd the port in the ports tree once a working version do exist again. It does not prevent anyone from working after the removal from the ports tree.
Btw now that we have overlay both in ports and poudriere (-devel) it is even more easy to work on such port outside of the tree and readd it later once it is working again.
This is the way things are being done in the ports tree since for ever (at least since before my time), nothing new here.
@joneum I hope you would reconsider, continue working on this and bringing it back to the tree once it is ready.
heya,
what are all these updates? :-)
Greetings
Jochen
Am 11.01.20 um 14:08 schrieb koobs (Kubilay Kocak):
koobs reopened this revision.
koobs added a comment.
This revision is now accepted and ready to land.Note: I have WIP updates to fix some of the errors If anyone has additions/fixed, please provide diffsREPOSITORY
rP FreeBSD ports repositoryCHANGES SINCE LAST ACTION
https://reviews.freebsd.org/D21570/new/REVISION DETAIL
https://reviews.freebsd.org/D21570EMAIL PREFERENCES
https://reviews.freebsd.org/settings/panel/emailpreferences/To: joneum, decke, bcr, dteske, lifanov, dmgk
Cc: rene, koobs, trasz, ag-freebsd-reviews_muc.de, nvass-gmx.com, peeyush.singh_gmail.com, asig_sigalas.eu, emaste, tremere_cainites.net, lwhsu, dmgk, 0mp, mat
To re-open the #Docker project on #FreeBSD, currently located at https://reviews.freebsd.org/D21570, who would want to donate via bountysource.com? This would be a way to reactivate the project, since it is very large. I'm asking for your opinion
To re-open the #Docker project on #FreeBSD, currently located at https://reviews.freebsd.org/D21570, who would want to donate via bountysource.com? This would be a way to reactivate the project, since it is very large. I'm asking for your opinion
I am interested into donating for the development of docker on FreeBSD. I am also willing to contribute some actual work, but I am not familiar with FreeBSD developer, but I am a software developer by profession.
Is there a better way to get into contact with the docker for FreeBSD developers? Is it desired that I would also contribute coding work? What would be the best way to get started?
Udate the docker Port to the current Status
sysutils/docker-freebsd/
- This directory was copied from sysutils/docker-freebsd.
sysutils/docker-freebsd/Makefile
# Created by: [email protected] # $FreeBSD$ # $FreeBSD$
PORTNAME= docker-freebsd PORTNAME= docker-freebsd PORTVERSION= 20150625 DISTVERSIONPREFIX= v PORTREVISION= 2 DISTVERSION= 19.03.13 CATEGORIES= sysutils CATEGORIES= sysutils
MAINTAINER= [email protected] MAINTAINER= [email protected] COMMENT= Docker containment system COMMENT= Docker Engine based on moby
Shouldn't moby be capitalized?
We can change that. At the moment we are concentrating on the port building. We will then see what "COMMENT" says at the end ... :-)
LICENSE= APACHE20 LICENSE= APACHE20 LICENSE_FILE= ${WRKSRC}/LICENSE LICENSE_FILE= ${WRKSRC}/LICENSE
BROKEN= fails to build BUILD_DEPENDS= bash:shells/bash DEPRECATED= Broken for more than 9 months EXPIRATION_DATE= 2020-01-10
BUILD_DEPENDS= bash:shells/bash \ USES= go sqlite3:databases/sqlite3 RUN_DEPENDS= bash:shells/bash \ sqlite3:databases/sqlite3
USES= go:run
USE_GITHUB= yes USE_GITHUB= yes GH_ACCOUNT= kvasdopil GH_ACCOUNT= moby GH_PROJECT= docker GH_PROJECT= moby GH_TAGNAME= 582db78 GH_SUBDIR= src/github.com/docker/docker
PLIST_FILES= bin/docker GO_TARGET= ./cmd/dockerd
Either GH_SUBDIR or GO_PKGNAME is OK, specifying both is not necessary. GO_PKGNAME gets inferred from GH_SUBDIR if omitted.
Could be just ./cmd/dockerd
USE_RC_SUBR= docker
do-build: do-build: @cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} AUTO_GOPATH=1 DOCKER_GITCOMMIT=${GH_TAGNAME} ./hack/make.sh binary @cd ${GO_WRKSRC} && export DOCKER_GITCOMMIT=${GH_TAGNAME} && ${SETENV} ${GO_ENV} ./hack/make.sh binary
do-install: @${MKDIR} ${STAGEDIR}${PREFIX}/bin ${INSTALL_PROGRAM} ${WRKSRC}/bundles/latest/binary/docker ${STAGEDIR}${PREFIX}/bin/
.include <bsd.port.mk> .include <bsd.port.mk>
sysutils/docker-freebsd/distinfo
sysutils/docker-freebsd/files/docker.in
- This file was deleted.
sysutils/docker-freebsd/files/patch-FreeBSD.adoc
- This file was added.
\ No newline at end of propertysvn:eol-stylenullnative
\ No newline at end of propertysvn:mime-typenulltext/plain
\ No newline at end of property
sysutils/docker-freebsd/files/patch-Makefile.freebsd
- This file was added.
\ No newline at end of propertysvn:eol-stylenullnative
\ No newline at end of propertysvn:mime-typenulltext/plain
\ No newline at end of property
sysutils/docker-freebsd/files/patch-builder_dockerfile_internals__freebsd.go
- This file was added.
\ No newline at end of propertysvn:eol-stylenullnative
\ No newline at end of propertysvn:mime-typenulltext/plain
\ No newline at end of property
Fix build on FreeBSD by copying linux implementation:
builder/dockerfile/internals.go:193:19: undefined: parseChownFlag
--- builder/dockerfile/internals_freebsd.go.orig 2019-03-08 14:02:51 UTC +++ builder/dockerfile/internals_freebsd.go @@ -0,0 +1,88 @@ +package dockerfile // import "github.com/docker/docker/builder/dockerfile" + +import ( + "path/filepath" + "strconv" + "strings" + + "github.com/docker/docker/pkg/idtools" + "github.com/docker/docker/pkg/symlink" + lcUser "github.com/opencontainers/runc/libcontainer/user" + "github.com/pkg/errors" +) + +func parseChownFlag(builder *Builder, state *dispatchState, chown, ctrRootPath string, identityMapping *idtools.IdentityMapping) (idtools.Identity, error) { + var userStr, grpStr string + parts := strings.Split(chown, ":") + if len(parts) > 2 { + return idtools.Identity{}, errors.New("invalid chown string format: " + chown) + } + if len(parts) == 1 { + // if no group specified, use the user spec as group as well + userStr, grpStr = parts[0], parts[0] + } else { + userStr, grpStr = parts[0], parts[1] + } + + passwdPath, err := symlink.FollowSymlinkInScope(filepath.Join(ctrRootPath, "etc", "passwd"), ctrRootPath) + if err != nil { + return idtools.Identity{}, errors.Wrapf(err, "can't resolve /etc/passwd path in container rootfs") + } + groupPath, err := symlink.FollowSymlinkInScope(filepath.Join(ctrRootPath, "etc", "group"), ctrRootPath) + if err != nil { + return idtools.Identity{}, errors.Wrapf(err, "can't resolve /etc/group path in container rootfs") + } + uid, err := lookupUser(userStr, passwdPath) + if err != nil { + return idtools.Identity{}, errors.Wrapf(err, "can't find uid for user "+userStr) + } + gid, err := lookupGroup(grpStr, groupPath) + if err != nil { + return idtools.Identity{}, errors.Wrapf(err, "can't find gid for group "+grpStr) + } + + // convert as necessary because of user namespaces + chownPair, err := identityMapping.ToHost(idtools.Identity{UID: uid, GID: gid}) + if err != nil { + return idtools.Identity{}, errors.Wrapf(err, "unable to convert uid/gid to host mapping") + } + return chownPair, nil +} + +func lookupUser(userStr, filepath string) (int, error) { + // if the string is actually a uid integer, parse to int and return + // as we don't need to translate with the help of files + uid, err := strconv.Atoi(userStr) + if err == nil { + return uid, nil + } + users, err := lcUser.ParsePasswdFileFilter(filepath, func(u lcUser.User) bool { + return u.Name == userStr + }) + if err != nil { + return 0, err + } + if len(users) == 0 { + return 0, errors.New("no such user: " + userStr) + } + return users[0].Uid, nil +} + +func lookupGroup(groupStr, filepath string) (int, error) { + // if the string is actually a gid integer, parse to int and return + // as we don't need to translate with the help of files + gid, err := strconv.Atoi(groupStr) + if err == nil { + return gid, nil + } + groups, err := lcUser.ParseGroupFileFilter(filepath, func(g lcUser.Group) bool { + return g.Name == groupStr + }) + if err != nil { + return 0, err + } + if len(groups) == 0 { + return 0, errors.New("no such group: " + groupStr) + } + return groups[0].Gid, nil +}
sysutils/docker-freebsd/files/patch-daemon_container__freebsd.go
- This file was added.
\ No newline at end of propertysvn:eol-stylenullnative
\ No newline at end of propertysvn:mime-typenulltext/plain
\ No newline at end of property
sysutils/docker-freebsd/files/patch-daemon_container__operations.go
- This file was added.
\ No newline at end of propertysvn:eol-stylenullnative
\ No newline at end of propertysvn:mime-typenulltext/plain
\ No newline at end of property
sysutils/docker-freebsd/files/patch-daemon_container__operations__freebsd.go
- This file was added.
\ No newline at end of propertysvn:eol-stylenullnative
\ No newline at end of propertysvn:mime-typenulltext/plain
\ No newline at end of property
sysutils/docker-freebsd/files/patch-daemon_container__operations__linux.go
- This file was added.
\ No newline at end of propertysvn:eol-stylenullnative
\ No newline at end of propertysvn:mime-typenulltext/plain
\ No newline at end of property
sysutils/docker-freebsd/files/patch-daemon_container__operations__unix.go
- This file was added.
\ No newline at end of propertysvn:eol-stylenullnative
\ No newline at end of propertysvn:mime-typenulltext/plain
\ No newline at end of property
sysutils/docker-freebsd/files/patch-daemon_daemon__freebsd.go
- This file was added.
\ No newline at end of propertysvn:eol-stylenullnative
\ No newline at end of propertysvn:mime-typenulltext/plain
\ No newline at end of property
sysutils/docker-freebsd/files/patch-daemon_daemon__linux.go
- This file was added.
\ No newline at end of propertysvn:eol-stylenullnative
\ No newline at end of propertysvn:mime-typenulltext/plain
\ No newline at end of property
sysutils/docker-freebsd/files/patch-daemon_daemon__unix.go
- This file was added.
\ No newline at end of propertysvn:eol-stylenullnative
\ No newline at end of propertysvn:mime-typenulltext/plain
\ No newline at end of property
sysutils/docker-freebsd/files/patch-daemon_exec__freebsd.go
- This file was added.
\ No newline at end of propertysvn:eol-stylenullnative
\ No newline at end of propertysvn:mime-typenulltext/plain
\ No newline at end of property
sysutils/docker-freebsd/files/patch-daemon_graphdriver_driver__freebsd.go
- This file was added.
\ No newline at end of propertysvn:eol-stylenullnative
\ No newline at end of propertysvn:mime-typenulltext/plain
\ No newline at end of property
Fix build error on FreeBSD:
daemon/graphdriver/driver_freebsd.go:17:38: cannot use &buf (type *unix.Statfs_t) as type *syscall.Statfs_t in argument to syscall.Statfs
--- daemon/graphdriver/driver_freebsd.go.orig 2019-02-26 00:29:56 UTC +++ daemon/graphdriver/driver_freebsd.go @@ -1,8 +1,7 @@ package graphdriver // import "github.com/docker/docker/daemon/graphdriver" import ( - "syscall" - + "github.com/docker/docker/pkg/mount" "golang.org/x/sys/unix" ) @@ -11,10 +10,49 @@ var ( priority = "zfs" ) +// GetFSMagic returns the filesystem id given the path. +func GetFSMagic(rootpath string) (FsMagic, error) { + var buf unix.Statfs_t + if err := unix.Statfs(rootpath, &buf); err != nil { + return 0, err + } + return FsMagic(buf.Type), nil +} + +// NewFsChecker returns a checker configured for the provided FsMagic +func NewFsChecker(t FsMagic) Checker { + return &fsChecker{ + t: t, + } +} + +type fsChecker struct { + t FsMagic +} + +func (c *fsChecker) IsMounted(path string) bool { + m, _ := Mounted(c.t, path) + return m +} + +// NewDefaultChecker returns a check that parses /proc/mountinfo to check +// if the specified path is mounted. +func NewDefaultChecker() Checker { + return &defaultChecker{} +} + +type defaultChecker struct { +} + +func (c *defaultChecker) IsMounted(path string) bool { + m, _ := mount.Mounted(path) + return m +} + // Mounted checks if the given path is mounted as the fs type func Mounted(fsType FsMagic, mountPath string) (bool, error) { var buf unix.Statfs_t - if err := syscall.Statfs(mountPath, &buf); err != nil { + if err := unix.Statfs(mountPath, &buf); err != nil { return false, err } return FsMagic(buf.Type) == fsType, nil
sysutils/docker-freebsd/files/patch-daemon_graphdriver_zfs_zfs.go
- This file was added.
\ No newline at end of propertysvn:eol-stylenullnative
\ No newline at end of propertysvn:mime-typenulltext/plain
\ No newline at end of property
sysutils/docker-freebsd/files/patch-daemon_inspect.go
- This file was added.
\ No newline at end of propertysvn:eol-stylenullnative
\ No newline at end of propertysvn:mime-typenulltext/plain
\ No newline at end of property
sysutils/docker-freebsd/files/patch-daemon_inspect__freebsd.go
- This file was added.
\ No newline at end of propertysvn:eol-stylenullnative
\ No newline at end of propertysvn:mime-typenulltext/plain
\ No newline at end of property
sysutils/docker-freebsd/files/patch-daemon_listeners_listeners__freebsd.go
sysutils/docker-freebsd/files/patch-daemon_monitor__freebsd.go
sysutils/docker-freebsd/files/patch-daemon_network.go
sysutils/docker-freebsd/files/patch-daemon_oci__freebsd.go
sysutils/docker-freebsd/files/patch-daemon_stats_collector__unix.go
sysutils/docker-freebsd/files/patch-daemon_update__freebsd.go
sysutils/docker-freebsd/files/patch-daemon_volumes__freebsd.go
sysutils/docker-freebsd/files/patch-hack_make.sh
sysutils/docker-freebsd/files/patch-libcontainerd_libcontainerd__freebsd.go
sysutils/docker-freebsd/files/patch-libcontainerd_oom__unix.go
sysutils/docker-freebsd/files/patch-libcontainerd_remote_client__freebsd.go
sysutils/docker-freebsd/files/patch-libcontainerd_supervisor_remote__daemon__freebsd.go
sysutils/docker-freebsd/files/patch-libcontainerd_supervisor_remote__daemon__options__freebsd.go
sysutils/docker-freebsd/files/patch-libcontainerd_supervisor_utils__freebsd.go
sysutils/docker-freebsd/files/patch-libcontainerd_types_types__freebsd.go
sysutils/docker-freebsd/files/patch-libcontainerd_utils__unix.go
sysutils/docker-freebsd/files/patch-pkg_archive_archive__unix.go
sysutils/docker-freebsd/files/patch-pkg_archive_changes__unix.go
sysutils/docker-freebsd/files/patch-pkg_mount_mountinfo__freebsd.go
sysutils/docker-freebsd/files/patch-pkg_mount_sharedsubtree__freebsd.go
sysutils/docker-freebsd/files/patch-pkg_parsers_operatingsystem_operatingsystem__freebsd.go
sysutils/docker-freebsd/files/patch-pkg_parsers_operatingsystem_operatingsystem__unix.go
sysutils/docker-freebsd/files/patch-pkg_system_meminfo__unsupported.go
sysutils/docker-freebsd/files/patch-pkg_system_mknod.go
sysutils/docker-freebsd/files/patch-plugin_manager__freebsd.go
sysutils/docker-freebsd/files/patch-runconfig_config.go
sysutils/docker-freebsd/files/patch-runconfig_hostconfig.go
sysutils/docker-freebsd/files/patch-vendor_github.com_containerd_cgroups_memory.go
sysutils/docker-freebsd/files/patch-vendor_github.com_containerd_containerd_archive_tar__unix.go
sysutils/docker-freebsd/files/patch-vendor_github.com_containerd_containerd_runtime_v1_linux_bundle.go
sysutils/docker-freebsd/files/patch-vendor_github.com_containerd_containerd_runtime_v1_linux_process.go
sysutils/docker-freebsd/files/patch-vendor_github.com_containerd_containerd_runtime_v1_linux_runtime.go
sysutils/docker-freebsd/files/patch-vendor_github.com_containerd_containerd_runtime_v1_linux_task.go
sysutils/docker-freebsd/files/patch-vendor_github.com_containerd_continuity_devices_devices__unix.go
sysutils/docker-freebsd/files/patch-vendor_github.com_containerd_continuity_fs_copy__unix.go
sysutils/docker-freebsd/files/patch-vendor_github.com_docker_libnetwork_drivers__freebsd.go
sysutils/docker-freebsd/files/patch-vendor_github.com_docker_libnetwork_drivers_bridge_bridge.go
sysutils/docker-freebsd/files/patch-vendor_github.com_docker_libnetwork_drivers_bridge_bridge__store.go
sysutils/docker-freebsd/files/patch-vendor_github.com_docker_libnetwork_drivers_bridge_interface.go
sysutils/docker-freebsd/files/patch-vendor_github.com_docker_libnetwork_drivers_bridge_link.go
sysutils/docker-freebsd/files/patch-vendor_github.com_docker_libnetwork_drivers_bridge_port__mapping.go
sysutils/docker-freebsd/files/patch-vendor_github.com_docker_libnetwork_drivers_bridge_setup.go
sysutils/docker-freebsd/files/patch-vendor_github.com_docker_libnetwork_drivers_bridge_setup__bridgenetfiltering.go
sysutils/docker-freebsd/files/patch-vendor_github.com_docker_libnetwork_drivers_bridge_setup__device.go
sysutils/docker-freebsd/files/patch-vendor_github.com_docker_libnetwork_drivers_bridge_setup__firewalld.go
sysutils/docker-freebsd/files/patch-vendor_github.com_docker_libnetwork_drivers_bridge_setup__ip__tables.go
sysutils/docker-freebsd/files/patch-vendor_github.com_docker_libnetwork_drivers_bridge_setup__ipv4.go
sysutils/docker-freebsd/files/patch-vendor_github.com_docker_libnetwork_drivers_bridge_setup__ipv6.go
sysutils/docker-freebsd/files/patch-vendor_github.com_docker_libnetwork_drivers_bridge_setup__verify.go
sysutils/docker-freebsd/files/patch-vendor_github.com_docker_libnetwork_drivers_freebsd_bridge_bridge.go
sysutils/docker-freebsd/files/patch-vendor_github.com_docker_libnetwork_drivers_freebsd_bridge_bridge__store.go
sysutils/docker-freebsd/files/patch-vendor_github.com_docker_libnetwork_drivers_freebsd_bridge_errors.go
sysutils/docker-freebsd/files/patch-vendor_github.com_docker_libnetwork_drivers_freebsd_bridge_port__mapping.go
sysutils/docker-freebsd/files/patch-vendor_github.com_docker_libnetwork_iptables_conntrack.go
sysutils/docker-freebsd/files/patch-vendor_github.com_docker_libnetwork_netutils_utils__freebsd.go
sysutils/docker-freebsd/files/patch-vendor_github.com_docker_libnetwork_ns_init__freebsd.go
sysutils/docker-freebsd/files/patch-vendor_github.com_docker_libnetwork_ns_init__unspecified.go
sysutils/docker-freebsd/files/patch-vendor_github.com_docker_libnetwork_portmapper_mapper__freebsd.go
sysutils/docker-freebsd/files/patch-vendor_github.com_docker_libnetwork_portmapper_proxy__freebsd.go
sysutils/docker-freebsd/files/patch-vendor_github.com_docker_libnetwork_portmapper_proxy__unix.go
sysutils/docker-freebsd/files/patch-vendor_github.com_docker_libnetwork_resolver__freebsd.go
sysutils/docker-freebsd/files/patch-vendor_github.com_docker_libnetwork_resolver__unix.go
sysutils/docker-freebsd/files/patch-vendor_github.com_docker_libnetwork_service__common.go
sysutils/docker-freebsd/files/patch-vendor_github.com_docker_libnetwork_service__freebsd.go
sysutils/docker-freebsd/files/patch-vendor_github.com_docker_libnetwork_service__unsupported.go
sysutils/docker-freebsd/files/patch-vendor_github.com_docker_swarmkit_manager_allocator_cnmallocator_drivers__unsupported.go
sysutils/docker-freebsd/files/patch-vendor_github.com_docker_swarmkit_node_node.go
sysutils/docker-freebsd/files/patch-vendor_github.com_godbus_dbus_transport__freebsd.go
sysutils/docker-freebsd/files/patch-vendor_github.com_moby_buildkit_executor_oci_spec__unix.go
sysutils/docker-freebsd/files/patch-vendor_github.com_moby_buildkit_executor_runcexecutor_executor.go
sysutils/docker-freebsd/files/patch-vendor_github.com_moby_buildkit_snapshot_localmounter__freebsd.go
sysutils/docker-freebsd/files/patch-vendor_github.com_moby_buildkit_snapshot_localmounter__unix.go
sysutils/docker-freebsd/files/patch-vendor_github.com_moby_buildkit_util_entitlements_security__freebsd.go
sysutils/docker-freebsd/files/patch-vendor_github.com_tonistiigi_fsutil_copy_copy__unix.go
sysutils/docker-freebsd/files/patch-vendor_github.com_tonistiigi_fsutil_diskwriter__unix.go
sysutils/docker-freebsd/files/patch-vendor_github.com_tonistiigi_fsutil_stat__unix.go
sysutils/docker-freebsd/files/patch-vendor_github.com_vishvananda_netlink_filter.go
sysutils/docker-freebsd/files/patch-vendor_github.com_vishvananda_netlink_handle__unspecified.go
sysutils/docker-freebsd/pkg-descr
sysutils/docker-freebsd/pkg-message
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK