image/Dockerfile: add osusergo, seccomp tags

osusergo build tag is needed for better chances to have
a proper static binary when Go >= 1.11 is used, and is
harmless otherwise.

seccomp build tag is needed so the resulting dockerd binary
has seccomp support.

[v2: add libseccomp-dev installation]

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Upstream-commit: 97596405f4300a7ae6eb7664f6c58785955dd8d3
Component: packaging
This commit is contained in:
Kirill Kolyshkin
2018-09-12 19:34:45 -07:00
committed by Kir Kolyshkin
parent 1cc5cccebc
commit ac99566390
+2 -1
View File
@@ -14,6 +14,7 @@ RUN apt-get update && apt-get install -y \
libc-dev \
libgcc-6-dev \
libltdl-dev \
libseccomp-dev \
libtool \
make
RUN grep "_COMMIT=" /*.installer |cut -f2- -d: > /binaries-commits
@@ -37,7 +38,7 @@ ENV DEFAULT_PRODUCT_LICENSE ${DEFAULT_PRODUCT_LICENSE}
# TODO The way we set the version could easily be simplified not to depend on hack/...
RUN bash ./hack/make/.go-autogen
RUN go build -o /sbin/dockerd \
-tags 'autogen netgo static_build selinux journald' \
-tags 'autogen netgo osusergo static_build seccomp selinux journald' \
-installsuffix netgo -a -buildmode=pie -ldflags '-w -extldflags "-static" ' \
github.com/docker/docker/cmd/dockerd