go1.16-devel-container/Dockerfile
Marco Varlese 6246b519ed Accepting request 881319 from home:dirkmueller:branches:devel:kubic:containers
- avoid using entrypoint in development build containers
- reduce unnecessary layers
- create and set a GOPATH 

- Include Frederics fix as well 
------------------------------------------------------------------
- Allow to override base container and release package using
  Docker arguments.

OBS-URL: https://build.opensuse.org/request/show/881319
OBS-URL: https://build.opensuse.org/package/show/devel:kubic:containers/go1.16-devel-container?expand=0&rev=12
2021-03-25 14:00:51 +00:00

29 lines
1.1 KiB
Docker

# Defines the tag for OBS and build script builds:
#!BuildTag: opensuse/golang:1.16
#!BuildTag: opensuse/golang:%%PKG_VERSION%%
#!BuildTag: opensuse/golang:%%PKG_VERSION%%.%RELEASE%
ARG BASE=opensuse/tumbleweed
FROM $BASE
# labelprefix=org.opensuse.golang
PREFIXEDLABEL org.opencontainers.image.title="Go 1.16 development container"
PREFIXEDLABEL org.opencontainers.image.description="Environment for Go 1.16 development"
PREFIXEDLABEL org.opencontainers.image.created="%BUILDTIME%"
PREFIXEDLABEL org.opencontainers.image.version="%%PKG_VERSION%%.%RELEASE%"
PREFIXEDLABEL org.openbuildservice.disturl="%DISTURL%"
PREFIXEDLABEL org.opensuse.reference="registry.opensuse.org/opensuse/golang:%%PKG_VERSION%%.%RELEASE%"
ENV GOLANG_VERSION %%PKG_VERSION%%
ENV GOPATH /go
ENV PATH $GOPATH/bin:$PATH
# Work around https://github.com/openSUSE/obs-build/issues/487
ARG RELEASE_PACKAGE=openSUSE-release-appliance-docker
RUN zypper install -y --no-recommends $RELEASE_PACKAGE go1.16 git-core && \
zypper clean && \
mkdir -p "$GOPATH/src" "$GOPATH/bin" && chmod -R 777 "$GOPATH"
WORKDIR $GOPATH
CMD [ "/bin/bash" ]