Skip to content

Commit 9ad506d

Browse files
authored
Merge pull request #13 from jianxiaoguo/main
chore(dockerfile): use drycc/base image
2 parents 400da5f + c86fff7 commit 9ad506d

2 files changed

Lines changed: 18 additions & 16 deletions

File tree

Dockerfile

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,37 @@
1-
FROM docker.io/minio/mc:latest as mc
2-
3-
41
FROM docker.io/drycc/go-dev:latest AS build
52
ARG LDFLAGS
63
ADD . /app
74
RUN export GO111MODULE=on \
85
&& cd /app \
9-
&& CGO_ENABLED=0 go build -ldflags "${LDFLAGS}" -o /usr/local/bin/boot boot.go
6+
&& CGO_ENABLED=0 init-stack go build -ldflags "${LDFLAGS}" -o /usr/local/bin/boot boot.go
107

118

12-
FROM docker.io/library/alpine:3.12
9+
FROM docker.io/drycc/base:bullseye
1310

14-
RUN adduser \
15-
-s /bin/sh \
16-
-D \
17-
-h /home/git \
18-
git \
19-
git
11+
RUN adduser --system \
12+
--shell /bin/sh \
13+
--home /home/git \
14+
--group \
15+
git
2016

21-
COPY rootfs /
22-
COPY --from=mc /usr/bin/mc /bin/mc
17+
COPY rootfs/bin /bin/
18+
COPY rootfs/etc/ssh /etc/ssh/
19+
COPY rootfs/docker-entrypoint.sh /docker-entrypoint.sh
2320
COPY --from=build /usr/local/bin/boot /usr/bin/boot
2421

25-
RUN apk add --update git sudo openssh-server coreutils tar xz jq bash \
22+
ENV MC_VERSION="2022.02.26.03.58.31" \
23+
JQ_VERSION="1.6"
24+
25+
RUN install-packages git openssh-server coreutils xz-utils tar \
26+
&& install-stack mc $MC_VERSION \
27+
&& install-stack jq $JQ_VERSION \
2628
&& mkdir -p /var/run/sshd \
2729
&& rm -rf /etc/ssh/ssh_host* \
2830
&& mkdir /apps \
2931
&& passwd -u git \
3032
&& chmod +x /bin/create_bucket /bin/normalize_storage /docker-entrypoint.sh
3133

32-
ENTRYPOINT ["/docker-entrypoint.sh"]
34+
ENTRYPOINT ["init-stack", "/docker-entrypoint.sh"]
3335

3436
CMD ["/usr/bin/boot", "server"]
3537

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ include versioning.mk
55
# dockerized development environment variables
66
REPO_PATH := github.com/drycc/${SHORT_NAME}
77
DEV_ENV_IMAGE := ${DEV_REGISTRY}/drycc/go-dev
8-
DEV_ENV_WORK_DIR := /go/src/${REPO_PATH}
8+
DEV_ENV_WORK_DIR := /opt/drycc/go/src/${REPO_PATH}
99
DEV_ENV_PREFIX := docker run --rm -v ${CURDIR}:${DEV_ENV_WORK_DIR} -w ${DEV_ENV_WORK_DIR}
1010
DEV_ENV_CMD := ${DEV_ENV_PREFIX} ${DEV_ENV_IMAGE}
1111
PLATFORM ?= linux/amd64,linux/arm64

0 commit comments

Comments
 (0)