Skip to content

Commit 00107c8

Browse files
committed
chore(Dockerfile): Refactor image to use ubuntu-slim
1 parent df3aee7 commit 00107c8

3 files changed

Lines changed: 34 additions & 26 deletions

File tree

Dockerfile

Lines changed: 0 additions & 23 deletions
This file was deleted.

Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,17 +40,17 @@ build: check-docker
4040
# For cases where we're building from local
4141
# We also alter the RC file to set the image name.
4242
docker-build: check-docker build
43-
docker build --rm -t ${IMAGE} .
43+
docker build --rm -t ${IMAGE} rootfs
4444
docker tag -f ${IMAGE} ${MUTABLE_IMAGE}
4545

4646
# Push to a registry that Kubernetes can access.
4747
docker-push: check-docker
4848
docker push ${IMAGE}
4949

5050
build-binary:
51-
${DEV_ENV_PREFIX} -e CGO_ENABLED=0 ${DEV_ENV_IMAGE} go build -a -installsuffix cgo -ldflags ${LDFLAGS} -o $(BINDIR)/${SHORT_NAME} main.go
51+
${DEV_ENV_CMD} go build -ldflags ${LDFLAGS} -o $(BINDIR)/${SHORT_NAME} main.go
5252
$(call check-static-binary,$(BINDIR)/${SHORT_NAME})
53-
${DEV_ENV_PREFIX} ${DEV_ENV_IMAGE} upx -9 --brute $(BINDIR)/${SHORT_NAME}
53+
${DEV_ENV_CMD} upx -9 --brute $(BINDIR)/${SHORT_NAME}
5454

5555
# Deploy is a Kubernetes-oriented target
5656
deploy: kube-secret kube-service kube-rc

rootfs/Dockerfile

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
FROM quay.io/deis/base:0.2.0
2+
3+
COPY . /
4+
5+
RUN apt-get update \
6+
&& apt-get install -y \
7+
git \
8+
golang \
9+
make \
10+
--no-install-recommends \
11+
&& export DOCKER_REGISTRY_TAG=minio \
12+
DOCKER_REGISTRY_REPO=https://github.com/deis/distribution.git \
13+
DISTRIBUTION_DIR=/go/src/github.com/docker/distribution \
14+
&& export GOPATH=/go:$DISTRIBUTION_DIR/Godeps/_workspace \
15+
&& git clone -b $DOCKER_REGISTRY_TAG --single-branch $DOCKER_REGISTRY_REPO $DISTRIBUTION_DIR \
16+
&& cd $DISTRIBUTION_DIR \
17+
&& make binaries \
18+
&& cp bin/* /bin/ \
19+
&& rm -rf /go \
20+
&& apt-get remove -y --auto-remove --purge \
21+
git \
22+
golang \
23+
make \
24+
&& apt-get clean \
25+
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/man /usr/share/doc
26+
27+
VOLUME ["/var/lib/registry"]
28+
CMD ["/opt/registry/sbin/registry"]
29+
EXPOSE 5000
30+
31+
ENV WORKFLOW_RELEASE 2.0.0

0 commit comments

Comments
 (0)