Skip to content

Commit

Permalink
Merge pull request edgexfoundry#115 from ernestojeda/update-arch-arg
Browse files Browse the repository at this point in the history
update to match edgex-global-pipelines ARCH
  • Loading branch information
ernestojeda authored Mar 1, 2020
2 parents 80e0f2c + 255e9f7 commit c0b3382
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
FROM ubuntu:18.04

# Allow specifying the architecture from the build arg command line (edgeXDocker.build passes this in)
# https://github.com/edgexfoundry/edgex-global-pipelines/blob/master/vars/edgeXDocker.groovy#L39
ARG arch
# https://github.com/edgexfoundry/edgex-global-pipelines/blob/master/vars/edgeXDocker.groovy#L37
ARG ARCH

# The following snippet is essentially the same as the upstream dockerfile
# here: https://github.com/snapcore/snapcraft/blob/master/docker/stable.Dockerfile
Expand All @@ -22,8 +22,8 @@ RUN apt-get update && \
apt-get install --yes \
curl sudo jq squashfs-tools && \
for thesnap in core core18 snapcraft; do \
dlUrl=$(curl -s -H 'X-Ubuntu-Series: 16' -H "X-Ubuntu-Architecture: $arch" "https://api.snapcraft.io/api/v1/snaps/details/$thesnap" | jq '.download_url' -r); \
dlSHA=$(curl -s -H 'X-Ubuntu-Series: 16' -H "X-Ubuntu-Architecture: $arch" "https://api.snapcraft.io/api/v1/snaps/details/$thesnap" | jq '.download_sha512' -r); \
dlUrl=$(curl -s -H 'X-Ubuntu-Series: 16' -H "X-Ubuntu-Architecture: $ARCH" "https://api.snapcraft.io/api/v1/snaps/details/$thesnap" | jq '.download_url' -r); \
dlSHA=$(curl -s -H 'X-Ubuntu-Series: 16' -H "X-Ubuntu-Architecture: $ARCH" "https://api.snapcraft.io/api/v1/snaps/details/$thesnap" | jq '.download_sha512' -r); \
curl -s -L $dlUrl --output $thesnap.snap; \
echo "$dlSHA $thesnap.snap"; \
echo "$dlSHA $thesnap.snap" > $thesnap.snap.sha512; \
Expand All @@ -45,7 +45,7 @@ RUN apt-get update && \
# above, try updating this Dockerfile to do same as whatever the upstream
# docker image does
ADD https://raw.githubusercontent.com/snapcore/snapcraft/25043ab3667d24688b3d93dcac9f9a74f35dae9e/docker/bin/snapcraft-wrapper /snap/bin/snapcraft
RUN sed -i -e "s@\"amd64\"@$arch@" /snap/bin/snapcraft && chmod +x /snap/bin/snapcraft
RUN sed -i -e "s@\"amd64\"@$ARCH@" /snap/bin/snapcraft && chmod +x /snap/bin/snapcraft

# Snapcraft will be in /snap/bin, so we need to put that on the $PATH
ENV PATH=/snap/bin:$PATH
Expand Down

0 comments on commit c0b3382

Please sign in to comment.