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

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions Dockerfile.build
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
FROM ubuntu:18.10

RUN apt-get update && apt-get install -y \
golang \
libbtrfs-dev \
RUN apt-get update && apt-get install -y wget
RUN wget -P /tmp/ https://dl.google.com/go/go1.11.linux-amd64.tar.gz && \
tar -xvf /tmp/go1.11.linux-amd64.tar.gz -C /usr/local/

ENV GOROOT /usr/local/go
ENV GOPATH /
ENV PATH $GOPATH/bin:$GOROOT/bin:$PATH

RUN apt-get install -y libbtrfs-dev \
git-core \
libdevmapper-dev \
libgpgme11-dev \
go-md2man \
libglib2.0-dev \
libostree-dev

ENV GOPATH=/
WORKDIR /src/github.com/containers/skopeo
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ LOCAL_BUILD_TAGS = $(BTRFS_BUILD_TAG) $(LIBDM_BUILD_TAG) $(OSTREE_BUILD_TAG) $(D
BUILDTAGS += $(LOCAL_BUILD_TAGS)

ifeq ($(DISABLE_CGO), 1)
override BUILDTAGS = containers_image_ostree_stub exclude_graphdriver_devicemapper exclude_graphdriver_btrfs containers_image_openpgp
override BUILDTAGS = netgo osusergo containers_image_ostree_stub exclude_graphdriver_devicemapper exclude_graphdriver_btrfs containers_image_openpgp
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR.

  • netgo bypasses NSS, including the glibc resolver (per https://golang.org/pkg/net/ , e.g. breaking .local names.
  • osusergo bypasses NSS as well, breaking e.g. LDAP uses.

Yes, I realize that these downsides are fundamentally necessary to make static builds work at all, but they are significant downsides.

I’m sorely tempted to just remove any mention of statically-linked or non-CGo builds from the repository (@rhatdan WDYT?).

If not that, at the very least README should document these downsides of a static build as well.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would hate to remove them, since it seems many in the GO world seem to want/require them. I guess Documenting the shortcomings is the best solution.

The NSS stuff is only important for rootless container/storage I believe?

endif

# make all DEBUG=1
Expand Down