mirror of
https://github.com/containers/podman.git
synced 2025-06-22 09:58:10 +08:00
@ -286,16 +286,7 @@ commit automatically with `git commit -s`.
|
|||||||
|
|
||||||
### Go Format and lint
|
### Go Format and lint
|
||||||
|
|
||||||
All code changes must pass ``make validate`` and ``make lint``, as
|
All code changes must pass ``make validate`` and ``make lint``.
|
||||||
executed in a standard container. The container image for this
|
|
||||||
purpose is provided at: ``quay.io/libpod/gate:master``. With
|
|
||||||
other tags available for different branches as needed. These
|
|
||||||
images are built automatically after merges to the branch.
|
|
||||||
|
|
||||||
#### Building the gate container locally
|
|
||||||
|
|
||||||
For local use, debugging, or experimentation, the gate image may
|
|
||||||
be built locally from the repository root, with the command:
|
|
||||||
|
|
||||||
```
|
```
|
||||||
podman build -t gate -f contrib/gate/Dockerfile .
|
podman build -t gate -f contrib/gate/Dockerfile .
|
||||||
|
@ -1,41 +0,0 @@
|
|||||||
FROM fedora:32
|
|
||||||
|
|
||||||
ENV GOPATH="/var/tmp/go" \
|
|
||||||
GOBIN="/var/tmp/go/bin" \
|
|
||||||
PATH="/var/tmp/go/bin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin" \
|
|
||||||
SRCPATH="/usr/src/libpod" \
|
|
||||||
GOSRC="/var/tmp/go/src/github.com/containers/podman"
|
|
||||||
|
|
||||||
# Only needed for installing build-time dependencies, then will be removed
|
|
||||||
COPY . $GOSRC
|
|
||||||
|
|
||||||
# Install packages from dependencies.txt, ignoring commented lines
|
|
||||||
# Note: adding conmon and crun so podman command checks will work
|
|
||||||
RUN dnf -y install \
|
|
||||||
$(grep "^[^#]" $GOSRC/contrib/dependencies.txt) diffutils containers-common fuse-overlayfs conmon crun runc --exclude container-selinux; \
|
|
||||||
sed -i -e 's|^#mount_program|mount_program|g' -e 's/# size.*/skip_mount_home = "true"/g' /etc/containers/storage.conf \
|
|
||||||
&& dnf clean all
|
|
||||||
|
|
||||||
# Install dependencies
|
|
||||||
RUN set -x && \
|
|
||||||
mkdir -p "$GOBIN" && \
|
|
||||||
mkdir -p /etc/cni/net.d && \
|
|
||||||
mkdir -p /etc/containers && \
|
|
||||||
install -D -m 755 $GOSRC/contrib/gate/entrypoint.sh /usr/local/bin/ && \
|
|
||||||
python3 -m pip install pre-commit
|
|
||||||
|
|
||||||
# Install cni config
|
|
||||||
COPY cni/87-podman-bridge.conflist /etc/cni/net.d/87-podman-bridge.conflist
|
|
||||||
# Make sure we have some policy for pulling images
|
|
||||||
COPY test/redhat_sigstore.yaml /etc/containers/registries.d/registry.access.redhat.com.yaml
|
|
||||||
|
|
||||||
WORKDIR "$GOSRC"
|
|
||||||
RUN make install.tools && \
|
|
||||||
cd / && \
|
|
||||||
rm -rf "$GOSRC" && \
|
|
||||||
mkdir -p "$GOSRC"
|
|
||||||
VOLUME ["/usr/src/libpod"]
|
|
||||||
# This entrypoint will synchronize the above volume ($SRCPATH) to $GOSRC before
|
|
||||||
# executing make. This ensures the original source remains prestine and is never
|
|
||||||
# modified by any lint/validation checks.
|
|
||||||
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
|
|
@ -1,6 +0,0 @@
|
|||||||

|
|
||||||
|
|
||||||
The "gate" image is a standard container image for lint-checking and validating
|
|
||||||
changes to the libpod repository. It must be built from the repository root as
|
|
||||||
[described in the contibutors guide](https://github.com/containers/podman/blob/master/CONTRIBUTING.md#go-format-and-lint).
|
|
||||||
The image is also used in [CI/CD automation](../../.cirrus.yml).
|
|
@ -1,23 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
set -e
|
|
||||||
|
|
||||||
die() {
|
|
||||||
echo "${2:-FATAL ERROR (but no message given!)} (gate container entrypoint)"
|
|
||||||
exit ${1:-1}
|
|
||||||
}
|
|
||||||
|
|
||||||
[[ -n "$SRCPATH" ]] || die 1 "ERROR: \$SRCPATH must be non-empty"
|
|
||||||
[[ -n "$GOPATH" ]] || die 2 "ERROR: \$GOPATH must be non-empty"
|
|
||||||
[[ -n "$GOSRC" ]] || die 3 "ERROR: \$GOSRC must be non-empty"
|
|
||||||
[[ -r "${SRCPATH}/contrib/gate/Dockerfile" ]] || \
|
|
||||||
die 4 "ERROR: Expecting libpod repository root at $SRCPATH"
|
|
||||||
|
|
||||||
# Working from a copy avoids needing to perturb the actual source files
|
|
||||||
# if/when developers use gate container for local testing
|
|
||||||
echo "Copying $SRCPATH to $GOSRC"
|
|
||||||
mkdir -vp "$GOSRC"
|
|
||||||
/usr/bin/rsync --recursive --links --quiet --safe-links \
|
|
||||||
--perms --times --delete "${SRCPATH}/" "${GOSRC}/"
|
|
||||||
cd "$GOSRC"
|
|
||||||
exec make "$@"
|
|
@ -93,10 +93,10 @@ registries = ['{{.Host}}:{{.Port}}']`
|
|||||||
})
|
})
|
||||||
|
|
||||||
It("podman search single registry flag", func() {
|
It("podman search single registry flag", func() {
|
||||||
search := podmanTest.Podman([]string{"search", "quay.io/libpod/gate:latest"})
|
search := podmanTest.Podman([]string{"search", "quay.io/skopeo/stable:latest"})
|
||||||
search.WaitWithDefaultTimeout()
|
search.WaitWithDefaultTimeout()
|
||||||
Expect(search.ExitCode()).To(Equal(0))
|
Expect(search.ExitCode()).To(Equal(0))
|
||||||
Expect(search.LineInOutputContains("quay.io/libpod/gate")).To(BeTrue())
|
Expect(search.LineInOutputContains("quay.io/skopeo/stable")).To(BeTrue())
|
||||||
})
|
})
|
||||||
|
|
||||||
It("podman search image with description", func() {
|
It("podman search image with description", func() {
|
||||||
|
Reference in New Issue
Block a user