Add support for journald on Podman (#283)

* Add support for journald

Signed-off-by: Salvatore Mazzarino <dev@mazzarino.cz>

* Added new files

Signed-off-by: Salvatore Mazzarino <dev@mazzarino.cz>

* Add Dockerfile.se

Signed-off-by: Salvatore Mazzarino <dev@mazzarino.cz>

* fix

Signed-off-by: Salvatore Mazzarino <dev@mazzarino.cz>

* Test run build

Signed-off-by: Salvatore Mazzarino <dev@mazzarino.cz>

* try systemd dep

Signed-off-by: Salvatore Mazzarino <dev@mazzarino.cz>

* add systemd-dev

Signed-off-by: Salvatore Mazzarino <dev@mazzarino.cz>

* fix build

* remove build

* remove dep

Co-authored-by: MacMiniX86Server <macminix86server@MacMiniX86Server.skynet.home>
This commit is contained in:
Salvatore Mazzarino 2021-12-04 05:34:02 +01:00 committed by GitHub
parent f8e0ee0f8f
commit c854a6a7df
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 75 additions and 0 deletions

View File

@ -0,0 +1,36 @@
FROM golang:1.16-stretch
# Run build
ARG DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y systemd zip git pkg-config libc6-arm64-cross libc6-dev-arm64-cross binutils-aarch64-linux-gnu libncurses5-dev build-essential bison flex libssl-dev bc gcc-aarch64-linux-gnu
RUN dpkg --add-architecture arm64 && apt-get update && apt-get install -y libseccomp-dev:arm64 && apt-get install -y libglib2.0-dev:arm64 && apt-get install -y libsystemd-dev:arm64
ARG PODMAN_VERSION=v3.4.2
ARG RUNC_VERSION=v1.0.2
ARG CONMON_VERSION=v2.0.30
ENV PKG_CONFIG_PATH=/usr/lib/aarch64-linux-gnu/pkgconfig/
ENV GOOS=linux
ENV GOARCH=arm64
ENV CC='aarch64-linux-gnu-gcc'
COPY ./podman.Makefile.se.patch /tmp
COPY ./runc.Makefile.patch /tmp
RUN mkdir -p /build && mkdir -p /tmp/release
WORKDIR /build
RUN git clone https://github.com/containers/podman && git clone https://github.com/opencontainers/runc && git clone https://github.com/containers/conmon
WORKDIR /build/podman
RUN git checkout $PODMAN_VERSION && patch Makefile /tmp/podman.Makefile.se.patch && make vendor local-cross && \
cp ./bin/podman.cross.linux.arm64 /tmp/release/podman-$PODMAN_VERSION && chmod +x /tmp/release/podman-$PODMAN_VERSION
WORKDIR /build/runc
RUN git checkout $RUNC_VERSION && patch Makefile /tmp/runc.Makefile.patch && make vendor localcross && \
cp ./runc-arm64 /tmp/release/runc-$RUNC_VERSION && chmod +x /tmp/release/runc-$RUNC_VERSION
WORKDIR /build/conmon
RUN git checkout $CONMON_VERSION && make vendor bin/conmon && cp bin/conmon /tmp/release/conmon-$CONMON_VERSION && chmod +x /tmp/release/conmon-$CONMON_VERSION
RUN mkdir -p /tmp/install/usr/bin && mkdir -p /tmp/install/usr/libexec/podman/ && mkdir -p /tmp/install/usr/share/containers/ && mkdir -p /tmp/install/etc/containers/
COPY seccomp.json /tmp/install/usr/share/containers/
COPY containers.conf /tmp/install/etc/containers/
RUN cp /tmp/release/podman-$PODMAN_VERSION /tmp/install/usr/bin/podman && cp /tmp/release/runc-$RUNC_VERSION /tmp/install/usr/bin/runc && cp /tmp/release/conmon-$CONMON_VERSION /tmp/install/usr/libexec/podman/conmon
WORKDIR /tmp/install
RUN zip -r /tmp/release/podman-install.zip *

View File

@ -0,0 +1,39 @@
diff --git a/Makefile b/Makefile
index 15d6d9fb6..8b44da6ae 100644
--- a/Makefile
+++ b/Makefile
@@ -65,7 +65,7 @@ SOURCES = $(shell find . -path './.*' -prune -o \( -name '*.go' -a ! -name '*_te
BUILDFLAGS := -mod=vendor $(BUILDFLAGS)
-BUILDTAGS_CROSS ?= containers_image_openpgp exclude_graphdriver_btrfs exclude_graphdriver_devicemapper exclude_graphdriver_overlay
+BUILDTAGS_CROSS ?= containers_image_openpgp exclude_graphdriver_btrfs exclude_graphdriver_devicemapper exclude_graphdriver_overlay seccomp $(shell hack/systemd_tag.sh)
CONTAINER_RUNTIME := $(shell command -v podman 2> /dev/null || echo docker)
OCI_RUNTIME ?= ""
@@ -133,16 +133,7 @@ export PATH := $(PATH):$(GOBIN)
GOMD2MAN ?= $(shell command -v go-md2man || echo '$(GOBIN)/go-md2man')
CROSS_BUILD_TARGETS := \
- bin/podman.cross.linux.amd64 \
- bin/podman.cross.linux.ppc64le \
- bin/podman.cross.linux.arm \
bin/podman.cross.linux.arm64 \
- bin/podman.cross.linux.386 \
- bin/podman.cross.linux.s390x \
- bin/podman.cross.linux.mips \
- bin/podman.cross.linux.mipsle \
- bin/podman.cross.linux.mips64 \
- bin/podman.cross.linux.mips64le
# Dereference variable $(1), return value if non-empty, otherwise raise an error.
err_if_empty = $(if $(strip $($(1))),$(strip $($(1))),$(error Required variable $(1) value is undefined, whitespace, or empty))
@@ -370,7 +361,7 @@ bin/podman.cross.%: .gopathok
TARGET="$*"; \
GOOS="$${TARGET%%.*}"; \
GOARCH="$${TARGET##*.}"; \
- CGO_ENABLED=0 \
+ CGO_ENABLED=1 \
$(GO) build \
$(BUILDFLAGS) \
-gcflags '$(GCFLAGS)' \