[go: up one dir, main page]

Tezt/Cloud: Add a way to get the current commit

What

Add a way to provide the commit to the docker image.

Why

Useful for Mac OS/X users.

How to test

Here is the current dockerfile I have made to get a quick way for mac OS/X users to get a working docker image for tezt-cloud:

FROM us-central1-docker.pkg.dev/nl-gitlab-runner/registry/tezos/tezos/ci/build:amd64--002d616cd6e1381a87f40e78248d8e8a0fe2d3a8 AS step1

FROM step1 AS step2
WORKDIR /build
RUN git init tezos
WORKDIR /build/tezos
RUN git remote add origin https://gitlab.com/tezos/tezos.git
RUN git fetch --depth 1 origin 2a54cb2e4124ad2fdc8ed5bfa98ebef1fa3d11fc
RUN git checkout 2a54cb2e4124ad2fdc8ed5bfa98ebef1fa3d11fc
RUN ./scripts/slim-mode.sh on
RUN eval $(opam env) && make octez-node

FROM step2

ARG COMMIT
RUN git fetch --depth 1 origin $COMMIT
RUN git checkout $COMMIT
RUN eval $(opam env) && make octez-node

USER root
# SSH key that will be used for the SSH server
ARG SSH_PUBLIC_KEY

# This is extracted from the link below
# https://dev.to/yakovlev_alexey/running-ssh-in-an-alpine-docker-container-3lop
RUN mkdir -p /root/.ssh \
    && chmod 0700 /root/.ssh \
    && echo "$SSH_PUBLIC_KEY" > /root/.ssh/authorized_keys \
    && apk add openrc openssh \
    && ssh-keygen -A \
    && echo -e "PasswordAuthentication no" >> /etc/ssh/sshd_config \
    && mkdir -p /run/openrc \
    && touch /run/openrc/softlevel

CMD ["-D", "-p", "30000", "-e"]
ENTRYPOINT ["/usr/sbin/sshd"]

Merge request reports

Loading