util-docker: Move LABEL to after image import (#1548)

A Dockerfile must start with the importation of a docker base image. It
is only after this point that `LABEL` be provided. Having `LABEL` at the
top of the Dockerfiles resulted in the Docker images failing to build.
This commit is contained in:
Bobby R. Bruce
2024-09-13 20:21:35 -07:00
committed by GitHub
parent f94cac6f65
commit 4126035f88
10 changed files with 18 additions and 26 deletions

View File

@@ -1,9 +1,9 @@
FROM --platform=${BUILDPLATFORM} ghcr.io/gem5/ubuntu-24.04_all-dependencies:latest
LABEL org.opencontainers.image.source=https://github.com/gem5/gem5 LABEL org.opencontainers.image.source=https://github.com/gem5/gem5
LABEL org.opencontainers.image.description="A Dockerfile to build an Ubuntu 24.04 docker image with all dependencies for gem5, with Clang 16." LABEL org.opencontainers.image.description="A Dockerfile to build an Ubuntu 24.04 docker image with all dependencies for gem5, with Clang 16."
LABEL org.opencontainers.image.licenses=BSD-3-Clause LABEL org.opencontainers.image.licenses=BSD-3-Clause
FROM --platform=${BUILDPLATFORM} ghcr.io/gem5/ubuntu-24.04_all-dependencies:latest
ARG version=16 # Version of Clang to install in this image. Default is 16. ARG version=16 # Version of Clang to install in this image. Default is 16.
RUN apt -y update && \ RUN apt -y update && \

View File

@@ -29,10 +29,6 @@
# container that can be built for x86, arm, and riscv and includes all # container that can be built for x86, arm, and riscv and includes all
# dependencies required for gem5 development. # dependencies required for gem5 development.
LABEL org.opencontainers.image.source=https://github.com/gem5/gem5
LABEL org.opencontainers.image.description="This Dockerfile creates a devcontainer for gem5 development referenced in ./devcontainer/devcontainer.json. The devcontainer is a multi-platform container that can be built for x86, arm, and riscv and includes all dependencies required for gem5 development."
LABEL org.opencontainers.image.licenses=BSD-3-Clause
# As this is a multi-platform image, we must build it using the # As this is a multi-platform image, we must build it using the
# "docker-bake.hcl" specification via `docker buildx`. To do so, execute the # "docker-bake.hcl" specification via `docker buildx`. To do so, execute the
# following: # following:
@@ -44,6 +40,11 @@ LABEL org.opencontainers.image.licenses=BSD-3-Clause
# there is a pre-built gem5 binary in each devcontainer. This can save time # there is a pre-built gem5 binary in each devcontainer. This can save time
# if the container is used for education or demonstration purposes. # if the container is used for education or demonstration purposes.
FROM ghcr.io/gem5/ubuntu-24.04_all-dependencies:latest as builder FROM ghcr.io/gem5/ubuntu-24.04_all-dependencies:latest as builder
LABEL org.opencontainers.image.source=https://github.com/gem5/gem5
LABEL org.opencontainers.image.description="This Dockerfile creates a devcontainer for gem5 development referenced in ./devcontainer/devcontainer.json. The devcontainer is a multi-platform container that can be built for x86, arm, and riscv and includes all dependencies required for gem5 development."
LABEL org.opencontainers.image.licenses=BSD-3-Clause
RUN wget https://github.com/gem5/gem5/archive/refs/tags/v24.0.tar.gz && \ RUN wget https://github.com/gem5/gem5/archive/refs/tags/v24.0.tar.gz && \
tar xzf v24.0.tar.gz && mv gem5-24.0 gem5 && rm v24.0.tar.gz tar xzf v24.0.tar.gz && mv gem5-24.0 gem5 && rm v24.0.tar.gz
WORKDIR /gem5 WORKDIR /gem5

View File

@@ -1,9 +1,9 @@
FROM --platform=${BUILDPLATFORM} ghcr.io/gem5/ubuntu-24.04_all-dependencies:latest
LABEL org.opencontainers.image.source=https://github.com/gem5/gem5 LABEL org.opencontainers.image.source=https://github.com/gem5/gem5
LABEL org.opencontainers.image.description="A Dockerfile to build an Ubuntu 24.04 docker image with all dependencies for gem5, with GCC 13." LABEL org.opencontainers.image.description="A Dockerfile to build an Ubuntu 24.04 docker image with all dependencies for gem5, with GCC 13."
LABEL org.opencontainers.image.licenses=BSD-3-Clause LABEL org.opencontainers.image.licenses=BSD-3-Clause
FROM --platform=${BUILDPLATFORM} ghcr.io/gem5/ubuntu-24.04_all-dependencies:latest
ARG version=13 # Version of GCC to install in this image. Default is 13. ARG version=13 # Version of GCC to install in this image. Default is 13.
RUN apt -y update && \ RUN apt -y update && \

View File

@@ -24,11 +24,12 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
FROM --platform=${BUILDPLATFORM} ubuntu:20.04
LABEL org.opencontainers.image.source=https://github.com/gem5/gem5 LABEL org.opencontainers.image.source=https://github.com/gem5/gem5
LABEL org.opencontainers.image.description="This dockerfile contains all the dependences necessary to run GPU applications in gem5 using the gcn5 (Vega) APU model." LABEL org.opencontainers.image.description="This dockerfile contains all the dependences necessary to run GPU applications in gem5 using the gcn5 (Vega) APU model."
LABEL org.opencontainers.image.licenses=BSD-3-Clause LABEL org.opencontainers.image.licenses=BSD-3-Clause
FROM --platform=${BUILDPLATFORM} ubuntu:20.04
ENV DEBIAN_FRONTEND=noninteractive ENV DEBIAN_FRONTEND=noninteractive
RUN apt -y update && \ RUN apt -y update && \

View File

@@ -27,11 +27,12 @@
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE. # POSSIBILITY OF SUCH DAMAGE.
FROM --platform=${BUILDPLATFORM} ubuntu:22.04
LABEL org.opencontainers.image.source=https://github.com/gem5/gem5 LABEL org.opencontainers.image.source=https://github.com/gem5/gem5
LABEL org.opencontainers.image.description="The Dockerfile in this directory is used to build applications to be run with GPU full system. Applications targeting AMD's ROCm GPU framework can be built using this docker (e.g., HIP, HSA, OpenCL, etc.)." LABEL org.opencontainers.image.description="The Dockerfile in this directory is used to build applications to be run with GPU full system. Applications targeting AMD's ROCm GPU framework can be built using this docker (e.g., HIP, HSA, OpenCL, etc.)."
LABEL org.opencontainers.image.licenses=BSD-3-Clause LABEL org.opencontainers.image.licenses=BSD-3-Clause
FROM --platform=${BUILDPLATFORM} ubuntu:22.04
ENV DEBIAN_FRONTEND=noninteractive ENV DEBIAN_FRONTEND=noninteractive
RUN apt -y update && apt -y upgrade && \ RUN apt -y update && apt -y upgrade && \
apt -y install build-essential git m4 scons zlib1g zlib1g-dev \ apt -y install build-essential git m4 scons zlib1g zlib1g-dev \

View File

@@ -23,14 +23,12 @@
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
FROM --platform=${BUILDPLATFORM} ghcr.io/gem5/ubuntu-24.04_all-dependencies:latest
LABEL org.opencontainers.image.source=https://github.com/gem5/gem5 LABEL org.opencontainers.image.source=https://github.com/gem5/gem5
LABEL org.opencontainers.image.description="A Dockerfile for using SST with gem5." LABEL org.opencontainers.image.description="A Dockerfile for using SST with gem5."
LABEL org.opencontainers.image.licenses=BSD-3-Clause LABEL org.opencontainers.image.licenses=BSD-3-Clause
FROM --platform=${BUILDPLATFORM} ghcr.io/gem5/ubuntu-24.04_all-dependencies:latest
# Setting the environmental variables # Setting the environmental variables
ENV PATH=$PATH:$SST_CORE_HOME/bin ENV PATH=$PATH:$SST_CORE_HOME/bin
ENV PKG_CONFIG_PATH=$PKG_CONFIG_PATH:$SST_CORE_HOME/lib/pkgconfig/ ENV PKG_CONFIG_PATH=$PKG_CONFIG_PATH:$SST_CORE_HOME/lib/pkgconfig/

View File

@@ -23,14 +23,11 @@
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
FROM --platform=${BUILDPLATFORM} ghcr.io/gem5/ubuntu-24.04_all-dependencies:latest
LABEL org.opencontainers.image.source=https://github.com/gem5/gem5 LABEL org.opencontainers.image.source=https://github.com/gem5/gem5
LABEL org.opencontainers.image.description="A Dockerfile for using SystemC with gem5." LABEL org.opencontainers.image.description="A Dockerfile for using SystemC with gem5."
LABEL org.opencontainers.image.licenses=BSD-3-Clause LABEL org.opencontainers.image.licenses=BSD-3-Clause
FROM --platform=${BUILDPLATFORM} ghcr.io/gem5/ubuntu-24.04_all-dependencies:latest
ENV CXX="g++" ENV CXX="g++"
ENV CXXFLAGS="-std=c++17" ENV CXXFLAGS="-std=c++17"

View File

@@ -23,14 +23,12 @@
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
FROM --platform=${BUILDPLATFORM} ubuntu:22.04
LABEL org.opencontainers.image.source=https://github.com/gem5/gem5 LABEL org.opencontainers.image.source=https://github.com/gem5/gem5
LABEL org.opencontainers.image.description="A Dockerfile to build an Ubuntu 22.04 docker image with all dependencies required for building and using gem5." LABEL org.opencontainers.image.description="A Dockerfile to build an Ubuntu 22.04 docker image with all dependencies required for building and using gem5."
LABEL org.opencontainers.image.licenses=BSD-3-Clause LABEL org.opencontainers.image.licenses=BSD-3-Clause
FROM --platform=${BUILDPLATFORM} ubuntu:22.04
ENV DEBIAN_FRONTEND=noninteractive ENV DEBIAN_FRONTEND=noninteractive
RUN apt -y update && apt -y upgrade && \ RUN apt -y update && apt -y upgrade && \
apt -y install build-essential git m4 scons zlib1g zlib1g-dev \ apt -y install build-essential git m4 scons zlib1g zlib1g-dev \

View File

@@ -23,14 +23,12 @@
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
FROM --platform=${BUILDPLATFORM} ubuntu:24.04
LABEL org.opencontainers.image.source=https://github.com/gem5/gem5 LABEL org.opencontainers.image.source=https://github.com/gem5/gem5
LABEL org.opencontainers.image.description="A Dockerfile to build an Ubuntu 24.04 docker image with all dependencies required for building and using gem5." LABEL org.opencontainers.image.description="A Dockerfile to build an Ubuntu 24.04 docker image with all dependencies required for building and using gem5."
LABEL org.opencontainers.image.licenses=BSD-3-Clause LABEL org.opencontainers.image.licenses=BSD-3-Clause
FROM --platform=${BUILDPLATFORM} ubuntu:24.04
ENV DEBIAN_FRONTEND=noninteractive ENV DEBIAN_FRONTEND=noninteractive
RUN apt -y update && apt -y upgrade && apt -y install \ RUN apt -y update && apt -y upgrade && apt -y install \
build-essential \ build-essential \

View File

@@ -23,14 +23,12 @@
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
FROM --platform=${BUILDPLATFORM} ubuntu:24.04
LABEL org.opencontainers.image.source=https://github.com/gem5/gem5 LABEL org.opencontainers.image.source=https://github.com/gem5/gem5
LABEL org.opencontainers.image.description="A Dockerfile to build an Ubuntu 24.04 docker image with minimal dependencies required for building and using gem5." LABEL org.opencontainers.image.description="A Dockerfile to build an Ubuntu 24.04 docker image with minimal dependencies required for building and using gem5."
LABEL org.opencontainers.image.licenses=BSD-3-Clause LABEL org.opencontainers.image.licenses=BSD-3-Clause
FROM --platform=${BUILDPLATFORM} ubuntu:24.04
ENV DEBIAN_FRONTEND=noninteractive ENV DEBIAN_FRONTEND=noninteractive
RUN apt -y update && apt -y upgrade && \ RUN apt -y update && apt -y upgrade && \
apt -y install build-essential m4 scons python3-dev apt -y install build-essential m4 scons python3-dev