Skip to content

Commit

Permalink
Fixing static build using container
Browse files Browse the repository at this point in the history
 1. LookupId panics on Linux+glibc static build (golang/go#24787)
 2. Updated go version to 1.11.0 in Dockerfile.build
 3. added go build tags netgo osusergo in static binary
  • Loading branch information
vijaysamanuriWM committed Jun 11, 2019
1 parent 6307635 commit b315969
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
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
endif

# make all DEBUG=1
Expand Down

0 comments on commit b315969

Please sign in to comment.