Skip to content

Commit a560271

Browse files
authored
Merge pull request #7 from circleci/sr/copy-and-link
[ONPREM-1222] Create the softlink in the target dir as init image entrypoint
2 parents c3cb47a + aaa5bcc commit a560271

File tree

2 files changed

+9
-13
lines changed

2 files changed

+9
-13
lines changed

runner-init/Dockerfile

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,8 @@
1-
FROM busybox:stable-musl as build
1+
FROM busybox:stable-musl
22

33
ARG ARCH=amd64
44

55
COPY ./bin/circleci-agent-${ARCH} /opt/circleci/circleci-agent
6-
RUN ln -s /opt/circleci/circleci-agent /opt/circleci/circleci
6+
COPY ./runner-init/init.sh /init.sh
77

8-
FROM scratch as temp
9-
10-
COPY --from=build /opt/circleci/circleci-agent /opt/circleci/circleci-agent
11-
COPY --from=build /opt/circleci/circleci /opt/circleci/circleci
12-
COPY --from=build /bin/cp /bin/cp
13-
14-
FROM scratch
15-
16-
COPY --from=temp / /
17-
18-
ENTRYPOINT ["/bin/cp"]
8+
ENTRYPOINT ["/init.sh"]

runner-init/init.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/usr/bin/env sh
2+
3+
dest=${1:?'task agent dest must be specified'}
4+
5+
cp /opt/circleci/circleci-agent "$dest"/circleci-agent
6+
ln -s "$dest"/circleci-agent "$dest"/circleci

0 commit comments

Comments
 (0)